@@ -11,6 +11,8 @@ class IterableAPITests: XCTestCase {
11
11
private static let apiKey = " zeeApiKey "
12
12
private static let email = " [email protected] "
13
13
private static let userId = " testUserId "
14
+ private static let apiEndPointUS = " https://api.iterable.com "
15
+ private static let apiEndPointEU = " https://api.eu.iterable.com "
14
16
15
17
override func setUp( ) {
16
18
super. setUp ( )
@@ -34,6 +36,32 @@ class IterableAPITests: XCTestCase {
34
36
XCTAssertEqual ( internalAPI. apiKey, IterableAPITests . apiKey)
35
37
}
36
38
39
+ func testInitializeWithDefaultDataRegion( ) {
40
+ let prodIntegrationName = " the-best-app-ever "
41
+
42
+ let config = IterableConfig ( )
43
+ config. pushIntegrationName = prodIntegrationName
44
+ config. inAppDisplayInterval = 1.0
45
+ config. dataRegion = IterableDataRegion . US
46
+
47
+ let internalAPI = InternalIterableAPI . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config)
48
+
49
+ XCTAssertEqual ( internalAPI. apiEndPointForTest, IterableAPITests . apiEndPointUS)
50
+ }
51
+
52
+ func testInitializeWithEUDataRegion( ) {
53
+ let prodIntegrationName = " the-best-app-ever "
54
+
55
+ let config = IterableConfig ( )
56
+ config. pushIntegrationName = prodIntegrationName
57
+ config. inAppDisplayInterval = 1.0
58
+ config. dataRegion = IterableDataRegion . EU
59
+
60
+ let internalAPI = InternalIterableAPI . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config)
61
+
62
+ XCTAssertEqual ( internalAPI. apiEndPointForTest, IterableAPITests . apiEndPointEU)
63
+ }
64
+
37
65
func testInitializeCheckEndpoint( ) {
38
66
let expectation1 = XCTestExpectation ( description: " api endpoint called " )
39
67
0 commit comments