Skip to content

Commit e3baac0

Browse files
authored
Merge pull request #25 from BranchMetrics/SDK-2240-prep-iOS-3.2.0-sync
sync with non-spm iOS repo
2 parents 1c63a76 + 71af529 commit e3baac0

File tree

209 files changed

+6248
-6148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+6248
-6148
lines changed

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "BNCSystemObserver.h"
1212
#import "BNCConfig.h"
1313
#import "BranchConstants.h"
14+
#import "Branch.h"
1415

1516
@interface BNCAPIServerTest : XCTestCase
1617

@@ -370,4 +371,42 @@ - (void)testValidationServiceURL_EUTracking {
370371
XCTAssertTrue([url hasPrefix:expectedUrlPrefix]);
371372
}
372373

374+
- (void)testDefaultAPIURL {
375+
BNCServerAPI *serverAPI = [BNCServerAPI new];
376+
XCTAssertNil(serverAPI.customAPIURL);
377+
378+
NSString *storedUrl = [[BNCServerAPI sharedInstance] installServiceURL];
379+
NSString *expectedUrl = [BNC_API_URL stringByAppendingString: @"/v1/install"];
380+
XCTAssertEqualObjects(storedUrl, expectedUrl);
381+
}
382+
383+
- (void)testSetAPIURL_Example {
384+
NSString *url = @"https://www.example.com";
385+
[Branch setAPIUrl:url];
386+
387+
NSString *storedUrl = [[BNCServerAPI sharedInstance] installServiceURL];
388+
NSString *expectedUrl = [url stringByAppendingString: @"/v1/install"];
389+
XCTAssertEqualObjects(storedUrl, expectedUrl);
390+
391+
[Branch setAPIUrl:BNC_API_URL];
392+
}
393+
394+
- (void)testSetAPIURL_InvalidHttp {
395+
NSString *url = @"Invalid://www.example.com";
396+
[Branch setAPIUrl:url];
397+
398+
NSString *storedUrl = [[BNCServerAPI sharedInstance] installServiceURL];
399+
NSString *expectedUrl = [BNC_API_URL stringByAppendingString: @"/v1/install"];
400+
XCTAssertEqualObjects(storedUrl, expectedUrl);
401+
}
402+
403+
- (void)testSetAPIURL_InvalidEmpty {
404+
NSString *url = @"";
405+
[Branch setAPIUrl:url];
406+
407+
NSString *storedUrl = [[BNCServerAPI sharedInstance] installServiceURL];
408+
NSString *expectedUrl = [BNC_API_URL stringByAppendingString: @"/v1/install"];
409+
XCTAssertEqualObjects(storedUrl, expectedUrl);
410+
}
411+
373412
@end

Branch-TestBed/Branch-SDK-Tests/BNCApplication.Test.m renamed to Branch-TestBed/Branch-SDK-Tests/BNCApplicationTests.m

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
// Copyright © 2018 Branch, Inc. All rights reserved.
77
//
88

9-
#import "BNCTestCase.h"
9+
#import <XCTest/XCTest.h>
1010
#import "BNCApplication.h"
1111
#import "BNCKeyChain.h"
1212

13-
@interface BNCApplicationTest : BNCTestCase
13+
@interface BNCApplicationTests : XCTestCase
1414
@end
1515

16-
@implementation BNCApplicationTest
16+
@implementation BNCApplicationTests
17+
18+
- (void)setUp {
19+
// Put setup code here. This method is called before the invocation of each test method in the class.
20+
}
21+
22+
- (void)tearDown {
23+
// Put teardown code here. This method is called after the invocation of each test method in the class.
24+
}
1725

1826
- (void)testApplication {
1927
// Test general info:

Branch-TestBed/Branch-SDK-Tests/BNCCrashlyticsWrapper.Test.m renamed to Branch-TestBed/Branch-SDK-Tests/BNCCrashlyticsWrapperTests.m

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// Copyright © 2017 Branch Metrics. All rights reserved.
77
//
88

9+
#import <XCTest/XCTest.h>
910
#import "BNCCrashlyticsWrapper.h"
10-
#import "BNCTestCase.h"
1111

1212
#pragma mark Crashlytics SDK Stand-In
1313

@@ -42,13 +42,20 @@ -(id)getCustomValueForKey:(NSString *)key {
4242

4343
#pragma mark - BNCCrashlyticsWrapperTest
4444

45-
@interface BNCCrashlyticsWrapperTest : BNCTestCase
45+
@interface BNCCrashlyticsWrapperTests : XCTestCase
4646
@end
4747

48-
@implementation BNCCrashlyticsWrapperTest
48+
@implementation BNCCrashlyticsWrapperTests
4949

50-
- (void) testSetValue {
50+
- (void)setUp {
51+
// Put setup code here. This method is called before the invocation of each test method in the class.
52+
}
53+
54+
- (void)tearDown {
55+
// Put teardown code here. This method is called after the invocation of each test method in the class.
56+
}
5157

58+
- (void)testSetValue {
5259
BNCCrashlyticsWrapper *wrapper = [BNCCrashlyticsWrapper wrapper];
5360
NSString *value = @"TestString";
5461
NSString *key = @"TestKey";

Branch-TestBed/Branch-SDK-Tests/BNCEncodingUtils.Test.m renamed to Branch-TestBed/Branch-SDK-Tests/BNCEncodingUtilsTests.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88

99
#import <XCTest/XCTest.h>
1010
#import "BNCEncodingUtils.h"
11-
#import "BNCTestCase.h"
1211

13-
@interface BNCEncodingUtilsTests : BNCTestCase
12+
@interface BNCEncodingUtilsTests : XCTestCase
1413
@end
1514

1615
@implementation BNCEncodingUtilsTests
1716

17+
- (void)setUp {
18+
// Put setup code here. This method is called before the invocation of each test method in the class.
19+
}
20+
21+
- (void)tearDown {
22+
// Put teardown code here. This method is called after the invocation of each test method in the class.
23+
}
24+
1825
#pragma mark - EncodeDictionaryToJsonString tests
1926

2027
- (void)testEncodeDictionaryToJsonStringWithExpectedParams {

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
// Copyright (c) 2015 Branch Metrics. All rights reserved.
77
//
88

9-
#import "BNCTestCase.h"
9+
#import <XCTest/XCTest.h>
1010
#import "BNCLinkData.h"
1111

12-
@interface BNCLinkDataTests : BNCTestCase
12+
@interface BNCLinkDataTests : XCTestCase
1313
@end
1414

1515
@implementation BNCLinkDataTests
1616

17+
- (void)setUp {
18+
// Put setup code here. This method is called before the invocation of each test method in the class.
19+
}
20+
21+
- (void)tearDown {
22+
// Put teardown code here. This method is called after the invocation of each test method in the class.
23+
}
24+
1725
- (void)testBasicObjectHash {
1826
BNCLinkData *a = [[BNCLinkData alloc] init];
1927
BNCLinkData *b = [[BNCLinkData alloc] init];

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

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

0 commit comments

Comments
 (0)