@@ -96,7 +96,7 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
96
96
97
97
let readAfterWrite = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
98
98
99
- XCTAssertEqual ( readAfterWrite! , model, " Failed with flavor \( flavor) " )
99
+ XCTAssertEqual ( readAfterWrite, model, " Failed with flavor \( flavor) " )
100
100
}
101
101
}
102
102
@@ -113,8 +113,8 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
113
113
114
114
let decoded = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
115
115
116
- XCTAssertNotNil ( decoded? . ts, " Failed with flavor \( flavor) " )
117
- if let ts = decoded? . ts {
116
+ XCTAssertNotNil ( decoded. ts, " Failed with flavor \( flavor) " )
117
+ if let ts = decoded. ts {
118
118
XCTAssertGreaterThan ( ts. seconds, 1_500_000_000 , " Failed with flavor \( flavor) " )
119
119
} else {
120
120
XCTFail ( " Expect server timestamp is set, but getting .pending " )
@@ -145,17 +145,17 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
145
145
146
146
let snapshot = readDocument ( forRef: docToWrite)
147
147
var decoded = try snapshot. data ( as: Model . self, with: . none)
148
- XCTAssertNil ( decoded? . ts)
148
+ XCTAssertNil ( decoded. ts)
149
149
150
150
decoded = try snapshot. data ( as: Model . self, with: . estimate)
151
- XCTAssertNotNil ( decoded? . ts)
152
- XCTAssertNotNil ( decoded? . ts? . seconds)
153
- XCTAssertGreaterThanOrEqual ( decoded! . ts!. seconds, now)
151
+ XCTAssertNotNil ( decoded. ts)
152
+ XCTAssertNotNil ( decoded. ts? . seconds)
153
+ XCTAssertGreaterThanOrEqual ( decoded. ts!. seconds, now)
154
154
155
155
decoded = try snapshot. data ( as: Model . self, with: . previous)
156
- XCTAssertNotNil ( decoded? . ts)
157
- XCTAssertNotNil ( decoded? . ts? . seconds)
158
- XCTAssertEqual ( decoded! . ts!. seconds, pastTimestamp. seconds)
156
+ XCTAssertNotNil ( decoded. ts)
157
+ XCTAssertNotNil ( decoded. ts? . seconds)
158
+ XCTAssertEqual ( decoded. ts!. seconds, pastTimestamp. seconds)
159
159
160
160
enableNetwork ( )
161
161
awaitExpectations ( )
@@ -230,7 +230,7 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
230
230
231
231
// Decoded result has "docId" auto-populated.
232
232
let decoded = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
233
- XCTAssertEqual ( decoded! , Model ( name: " name " , docId: docToWrite) )
233
+ XCTAssertEqual ( decoded, Model ( name: " name " , docId: docToWrite) )
234
234
}
235
235
236
236
func testSelfDocumentIDWithCustomCodable( ) throws {
@@ -277,7 +277,7 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
277
277
278
278
// Decoded result has "docId" auto-populated.
279
279
let decoded = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
280
- XCTAssertEqual ( decoded! , Model ( name: " name " , docId: docToWrite) )
280
+ XCTAssertEqual ( decoded, Model ( name: " name " , docId: docToWrite) )
281
281
}
282
282
283
283
func testSetThenMerge( ) throws {
@@ -298,18 +298,18 @@ class CodableIntegrationTests: FSTIntegrationTestCase {
298
298
299
299
var readAfterUpdate = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
300
300
301
- XCTAssertEqual ( readAfterUpdate! , Model ( name: " test " ,
302
- age: 43 , hobby: " No " ) , " Failed with flavor \( flavor) " )
301
+ XCTAssertEqual ( readAfterUpdate, Model ( name: " test " ,
302
+ age: 43 , hobby: " No " ) , " Failed with flavor \( flavor) " )
303
303
304
304
let newUpdate = Model ( name: " xxxx " , age: 10 , hobby: " Play " )
305
305
// Note 'name' is not updated.
306
306
try setData ( from: newUpdate, forDocument: docToWrite, withFlavor: flavor,
307
307
mergeFields: [ " age " , FieldPath ( [ " hobby " ] ) ] )
308
308
309
309
readAfterUpdate = try readDocument ( forRef: docToWrite) . data ( as: Model . self)
310
- XCTAssertEqual ( readAfterUpdate! , Model ( name: " test " ,
311
- age: 10 ,
312
- hobby: " Play " ) , " Failed with flavor \( flavor) " )
310
+ XCTAssertEqual ( readAfterUpdate, Model ( name: " test " ,
311
+ age: 10 ,
312
+ hobby: " Play " ) , " Failed with flavor \( flavor) " )
313
313
}
314
314
}
315
315
0 commit comments