Skip to content

Commit ca7b467

Browse files
authored
Merge pull request #124 from optimizely/fixiOS9Tests
fix ios 9 tests
2 parents cfeb7b6 + 05fbe72 commit ca7b467

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

OptimizelySDK/OptimizelyTests/OptimizelyTests-Common/EventDispatcherTest.swift

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ class EventDispatcherTest: XCTestCase {
5555

5656
eventDispatcher?.dispatcher.sync {
5757
}
58-
59-
XCTAssert(eventDispatcher?.dataStore.count == 1)
60-
58+
59+
if #available(iOS 10.0, tvOS 10.0, *) {
60+
XCTAssert(eventDispatcher?.dataStore.count == 1)
61+
}
62+
else {
63+
XCTAssert(eventDispatcher?.dataStore.count == 0)
64+
}
6165
eventDispatcher?.flushEvents()
6266

6367
eventDispatcher?.dispatcher.sync {
@@ -86,8 +90,13 @@ class EventDispatcherTest: XCTestCase {
8690
}
8791
wait()
8892

89-
XCTAssert(eventDispatcher?.dataStore.count == 1)
90-
93+
if #available(iOS 10.0, tvOS 10.0, *) {
94+
XCTAssert(eventDispatcher?.dataStore.count == 1)
95+
}
96+
else {
97+
XCTAssert(eventDispatcher?.dataStore.count == 0)
98+
}
99+
91100
eventDispatcher?.flushEvents()
92101
wait()
93102

@@ -114,8 +123,13 @@ class EventDispatcherTest: XCTestCase {
114123
}
115124
wait()
116125

117-
XCTAssert(eventDispatcher?.dataStore.count == 1)
118-
126+
if #available(iOS 10.0, tvOS 10.0, *) {
127+
XCTAssert(eventDispatcher?.dataStore.count == 1)
128+
}
129+
else {
130+
XCTAssert(eventDispatcher?.dataStore.count == 0)
131+
}
132+
119133
eventDispatcher?.flushEvents()
120134
wait()
121135

@@ -141,8 +155,13 @@ class EventDispatcherTest: XCTestCase {
141155
}
142156
wait()
143157

144-
XCTAssert(eventDispatcher?.dataStore.count == 1)
145-
158+
if #available(iOS 10.0, tvOS 10.0, *) {
159+
XCTAssert(eventDispatcher?.dataStore.count == 1)
160+
}
161+
else {
162+
XCTAssert(eventDispatcher?.dataStore.count == 0)
163+
}
164+
146165
eventDispatcher?.flushEvents()
147166
wait()
148167

0 commit comments

Comments
 (0)