Skip to content

Commit ad41ba4

Browse files
committed
Removed v1/event code
1 parent 4183ec2 commit ad41ba4

16 files changed

+122
-754
lines changed

Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#import "BranchInstallRequest.h"
1616
#import "BranchOpenRequest.h"
1717
#import "BranchEvent.h"
18-
#import "BNCCommerceEvent.h"
19-
#import "BranchUserCompletedActionRequest.h"
2018
#import "BranchSetIdentityRequest.h"
2119
#import "BranchLogoutRequest.h"
2220

@@ -106,32 +104,6 @@ - (void)testArchiveEventRequest {
106104
// The request object is not very test friendly, so comparing the two is not helpful at the moment
107105
}
108106

109-
- (void)testArchiveCommerceEventRequest {
110-
BranchCommerceEventRequest *object = [BranchCommerceEventRequest new];
111-
112-
NSData *archived = [self.queue archiveObject:object];
113-
XCTAssertNotNil(archived);
114-
115-
BranchCommerceEventRequest *unarchived = [self.queue unarchiveObjectFromData:archived];
116-
XCTAssertNotNil(unarchived);
117-
XCTAssert([unarchived isKindOfClass:[BranchCommerceEventRequest class]]);
118-
119-
// The request object is not very test friendly, so comparing the two is not helpful at the moment
120-
}
121-
122-
- (void)testArchiveUserCompletedActionRequest {
123-
BranchUserCompletedActionRequest *object = [BranchUserCompletedActionRequest new];
124-
125-
NSData *archived = [self.queue archiveObject:object];
126-
XCTAssertNotNil(archived);
127-
128-
BranchUserCompletedActionRequest *unarchived = [self.queue unarchiveObjectFromData:archived];
129-
XCTAssertNotNil(unarchived);
130-
XCTAssert([unarchived isKindOfClass:[BranchUserCompletedActionRequest class]]);
131-
132-
// The request object is not very test friendly, so comparing the two is not helpful at the moment
133-
}
134-
135107
- (void)testArchiveSetIdentityRequest {
136108
BranchSetIdentityRequest *object = [BranchSetIdentityRequest new];
137109

Branch-TestBed/Branch-SDK-Tests/BranchEvent.Test.m

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -170,99 +170,6 @@ - (void) testEvent {
170170
[serverInterfaceMock stopMocking];
171171
}
172172

173-
- (void) testUserCompletedAction {
174-
// Mock the result. Fix up the expectedParameters for simulator hardware --
175-
176-
NSMutableDictionary *expectedRequest =
177-
[self mutableDictionaryFromBundleJSONWithKey:@"V2EventJSON"];
178-
expectedRequest[@"branch_key"] = Branch.branchKey;
179-
expectedRequest[@"user_data"] = [[BNCDeviceInfo getInstance] v2dictionary];
180-
expectedRequest[@"event_data"] = nil;
181-
expectedRequest[@"custom_data"] = nil;
182-
expectedRequest[@"customer_event_alias"] = nil;
183-
184-
Branch *branch = [Branch getInstance:@"key_live_foo"];
185-
XCTestExpectation *expectation = [self expectationWithDescription:@"v2-event-user-action"];
186-
id serverInterfaceMock = OCMPartialMock(branch.serverInterface);
187-
188-
OCMStub(
189-
[serverInterfaceMock genericHTTPRequest:[OCMArg any]
190-
retryNumber:0
191-
callback:[OCMArg any]
192-
retryHandler:[OCMArg any]]
193-
).andDo(^(NSInvocation *invocation) {
194-
195-
__unsafe_unretained NSURLRequest *request = nil;
196-
[invocation getArgument:&request atIndex:2];
197-
198-
NSError *error = nil;
199-
NSString *url = request.URL.absoluteString;
200-
NSData *bodyData = request.HTTPBody;
201-
NSDictionary *parameters =
202-
[NSJSONSerialization JSONObjectWithData:bodyData options:0 error:&error];
203-
XCTAssertNil(error);
204-
205-
NSLog(@"2");
206-
NSLog(@"URL: %@.", url);
207-
NSLog(@"Body: %@.", parameters);
208-
209-
if ([url containsString:@"branch.io/v2/event/standard"]) {
210-
XCTAssertEqualObjects(expectedRequest, parameters);
211-
[expectation fulfill];
212-
} else {
213-
XCTFail(@"URL is unexpected. %@", url);
214-
}
215-
});
216-
217-
// Set up the Branch Univseral Object --
218-
219-
BranchUniversalObject *buo = [BranchUniversalObject new];
220-
buo.canonicalIdentifier = @"item/12345";
221-
buo.canonicalUrl = @"https://branch.io/deepviews";
222-
buo.title = @"My Content Title";
223-
buo.contentDescription = @"my_product_description1";
224-
buo.imageUrl = @"https://test_img_url";
225-
buo.keywords = @[ @"My_Keyword1", @"My_Keyword2"];
226-
buo.creationDate = [NSDate dateWithTimeIntervalSince1970:1501869445321.0/1000.0];
227-
buo.expirationDate = [NSDate dateWithTimeIntervalSince1970:212123232544.0/1000.0];
228-
buo.locallyIndex = YES;
229-
buo.publiclyIndex = NO;
230-
231-
buo.contentMetadata.contentSchema = BranchContentSchemaCommerceProduct;
232-
buo.contentMetadata.quantity = 2;
233-
buo.contentMetadata.price = [NSDecimalNumber decimalNumberWithString:@"23.2"];
234-
buo.contentMetadata.currency = BNCCurrencyUSD;
235-
buo.contentMetadata.sku = @"1994320302";
236-
buo.contentMetadata.productName = @"my_product_name1";
237-
buo.contentMetadata.productBrand = @"my_prod_Brand1";
238-
buo.contentMetadata.productCategory = BNCProductCategoryBabyToddler;
239-
buo.contentMetadata.productVariant = @"3T";
240-
buo.contentMetadata.condition = @"FAIR";
241-
buo.contentMetadata.ratingAverage = 5;
242-
buo.contentMetadata.ratingCount = 5;
243-
buo.contentMetadata.ratingMax = 7;
244-
buo.contentMetadata.rating = 6;
245-
buo.contentMetadata.addressStreet = @"Street_name1";
246-
buo.contentMetadata.addressCity = @"city1";
247-
buo.contentMetadata.addressRegion = @"Region1";
248-
buo.contentMetadata.addressCountry = @"Country1";
249-
buo.contentMetadata.addressPostalCode= @"postal_code";
250-
buo.contentMetadata.latitude = 12.07;
251-
buo.contentMetadata.longitude = -97.5;
252-
buo.contentMetadata.imageCaptions = (id) @[@"my_img_caption1", @"my_img_caption_2"];
253-
buo.contentMetadata.customMetadata = (NSMutableDictionary*) @{
254-
@"Custom_Content_metadata_key1": @"Custom_Content_metadata_val1",
255-
@"Custom_Content_metadata_key2": @"Custom_Content_metadata_val2"
256-
};
257-
258-
// Set up and invoke --
259-
[branch clearNetworkQueue];
260-
[buo userCompletedAction:@"PURCHASE"];
261-
262-
[self waitForExpectationsWithTimeout:5.0 handler:nil];
263-
[serverInterfaceMock stopMocking];
264-
}
265-
266173
- (void) testExampleSyntax {
267174
BranchUniversalObject *contentItem = [BranchUniversalObject new];
268175
contentItem.canonicalIdentifier = @"item/123";

Branch-TestBed/Branch-SDK-Tests/BranchUserCompletedActionTests.m

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)