@@ -145,7 +145,8 @@ - (void)testGetDocumentWhileOnlineCacheOnly {
145
145
// get doc and ensure that it exists, *is* from the cache, and matches
146
146
// the initialData.
147
147
FIRDocumentSnapshot *result =
148
- [self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache]];
148
+ [self readDocumentForRef: doc
149
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache]];
149
150
XCTAssertTrue (result.exists );
150
151
XCTAssertTrue (result.metadata .fromCache );
151
152
XCTAssertFalse (result.metadata .hasPendingWrites );
@@ -167,7 +168,7 @@ - (void)testGetCollectionWhileOnlineCacheOnly {
167
168
// initialDocs.
168
169
FIRQuerySnapshot *result =
169
170
[self readDocumentSetForRef: col
170
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]];
171
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]];
171
172
XCTAssertTrue (result.metadata .fromCache );
172
173
XCTAssertFalse (result.metadata .hasPendingWrites );
173
174
XCTAssertEqualObjects (FIRQuerySnapshotGetData (result), (@[
@@ -204,7 +205,8 @@ - (void)testGetDocumentWhileOfflineCacheOnly {
204
205
// get doc and ensure it exists, *is* from the cache, and matches the
205
206
// newData.
206
207
FIRDocumentSnapshot *result =
207
- [self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache]];
208
+ [self readDocumentForRef: doc
209
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache]];
208
210
XCTAssertTrue (result.exists );
209
211
XCTAssertTrue (result.metadata .fromCache );
210
212
XCTAssertTrue (result.metadata .hasPendingWrites );
@@ -236,7 +238,7 @@ - (void)testGetCollectionWhileOfflineCacheOnly {
236
238
// data.
237
239
FIRQuerySnapshot *result =
238
240
[self readDocumentSetForRef: col
239
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]];
241
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]];
240
242
XCTAssertTrue (result.metadata .fromCache );
241
243
XCTAssertTrue (result.metadata .hasPendingWrites );
242
244
XCTAssertEqualObjects (FIRQuerySnapshotGetData (result), (@[
@@ -262,7 +264,8 @@ - (void)testGetDocumentWhileOnlineServerOnly {
262
264
// get doc and ensure that it exists, is *not* from the cache, and matches
263
265
// the initialData.
264
266
FIRDocumentSnapshot *result =
265
- [self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer]];
267
+ [self readDocumentForRef: doc
268
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer]];
266
269
XCTAssertTrue (result.exists );
267
270
XCTAssertFalse (result.metadata .fromCache );
268
271
XCTAssertFalse (result.metadata .hasPendingWrites );
@@ -284,7 +287,7 @@ - (void)testGetCollectionWhileOnlineServerOnly {
284
287
// initialData.
285
288
FIRQuerySnapshot *result =
286
289
[self readDocumentSetForRef: col
287
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]];
290
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]];
288
291
XCTAssertFalse (result.metadata .fromCache );
289
292
XCTAssertFalse (result.metadata .hasPendingWrites );
290
293
XCTAssertEqualObjects (FIRQuerySnapshotGetData (result), (@[
@@ -311,7 +314,7 @@ - (void)testGetDocumentWhileOfflineServerOnly {
311
314
312
315
// attempt to get doc and ensure it cannot be retreived
313
316
XCTestExpectation *failedGetDocCompletion = [self expectationWithDescription: @" failedGetDoc" ];
314
- [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
317
+ [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
315
318
completion: ^(FIRDocumentSnapshot *snapshot, NSError *error) {
316
319
XCTAssertNotNil (error);
317
320
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -337,7 +340,7 @@ - (void)testGetCollectionWhileOfflineServerOnly {
337
340
338
341
// attempt to get docs and ensure they cannot be retreived
339
342
XCTestExpectation *failedGetDocsCompletion = [self expectationWithDescription: @" failedGetDocs" ];
340
- [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
343
+ [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
341
344
completion: ^(FIRQuerySnapshot *snapshot, NSError *error) {
342
345
XCTAssertNotNil (error);
343
346
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -377,23 +380,24 @@ - (void)testGetDocumentWhileOfflineWithDifferentGetOptions {
377
380
// get doc (from cache) and ensure it exists, *is* from the cache, and
378
381
// matches the newData.
379
382
FIRDocumentSnapshot *result =
380
- [self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache]];
383
+ [self readDocumentForRef: doc
384
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache]];
381
385
XCTAssertTrue (result.exists );
382
386
XCTAssertTrue (result.metadata .fromCache );
383
387
XCTAssertTrue (result.metadata .hasPendingWrites );
384
388
XCTAssertEqualObjects (result.data , newData);
385
389
386
390
// attempt to get doc (with default get options)
387
- result =
388
- [ self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceDefault ]];
391
+ result = [ self readDocumentForRef: doc
392
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceDefault ]];
389
393
XCTAssertTrue (result.exists );
390
394
XCTAssertTrue (result.metadata .fromCache );
391
395
XCTAssertTrue (result.metadata .hasPendingWrites );
392
396
XCTAssertEqualObjects (result.data , newData);
393
397
394
398
// attempt to get doc (from the server) and ensure it cannot be retreived
395
399
XCTestExpectation *failedGetDocCompletion = [self expectationWithDescription: @" failedGetDoc" ];
396
- [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
400
+ [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
397
401
completion: ^(FIRDocumentSnapshot *snapshot, NSError *error) {
398
402
XCTAssertNotNil (error);
399
403
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -437,7 +441,7 @@ - (void)testGetCollectionWhileOfflineWithDifferentGetOptions {
437
441
// matches the updated data.
438
442
FIRQuerySnapshot *result =
439
443
[self readDocumentSetForRef: col
440
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]];
444
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]];
441
445
XCTAssertTrue (result.metadata .fromCache );
442
446
XCTAssertTrue (result.metadata .hasPendingWrites );
443
447
XCTAssertEqualObjects (FIRQuerySnapshotGetData (result), (@[
@@ -454,7 +458,7 @@ - (void)testGetCollectionWhileOfflineWithDifferentGetOptions {
454
458
455
459
// attempt to get docs (with default get options)
456
460
result = [self readDocumentSetForRef: col
457
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceDefault ]];
461
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceDefault ]];
458
462
XCTAssertTrue (result.metadata .fromCache );
459
463
XCTAssertEqualObjects (FIRQuerySnapshotGetData (result), (@[
460
464
@{@" key1" : @" value1" }, @{@" key2" : @" value2" , @" key2b" : @" value2b" },
@@ -470,7 +474,7 @@ - (void)testGetCollectionWhileOfflineWithDifferentGetOptions {
470
474
471
475
// attempt to get docs (from the server) and ensure they cannot be retreived
472
476
XCTestExpectation *failedGetDocsCompletion = [self expectationWithDescription: @" failedGetDocs" ];
473
- [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
477
+ [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
474
478
completion: ^(FIRQuerySnapshot *snapshot, NSError *error) {
475
479
XCTAssertNotNil (error);
476
480
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -543,7 +547,7 @@ - (void)testGetNonExistingDocWhileOnlineCacheOnly {
543
547
// certain documents *don't* exist.
544
548
XCTestExpectation *getNonExistingDocCompletion =
545
549
[self expectationWithDescription: @" getNonExistingDoc" ];
546
- [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]
550
+ [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]
547
551
completion: ^(FIRDocumentSnapshot *snapshot, NSError *error) {
548
552
XCTAssertNotNil (error);
549
553
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -559,7 +563,7 @@ - (void)testGetNonExistingCollectionWhileOnlineCacheOnly {
559
563
// get collection and ensure it's empty and that it *is* from the cache.
560
564
FIRQuerySnapshot *snapshot =
561
565
[self readDocumentSetForRef: col
562
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]];
566
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]];
563
567
XCTAssertEqual (snapshot.count , 0 );
564
568
XCTAssertEqual (snapshot.documentChanges .count , 0 );
565
569
XCTAssertTrue (snapshot.metadata .fromCache );
@@ -577,7 +581,7 @@ - (void)testGetNonExistingDocWhileOfflineCacheOnly {
577
581
// certain documents *don't* exist.
578
582
XCTestExpectation *getNonExistingDocCompletion =
579
583
[self expectationWithDescription: @" getNonExistingDoc" ];
580
- [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]
584
+ [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]
581
585
completion: ^(FIRDocumentSnapshot *snapshot, NSError *error) {
582
586
XCTAssertNotNil (error);
583
587
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -596,7 +600,7 @@ - (void)testGetNonExistingCollectionWhileOfflineCacheOnly {
596
600
// get collection and ensure it's empty and that it *is* from the cache.
597
601
FIRQuerySnapshot *snapshot =
598
602
[self readDocumentSetForRef: col
599
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceCache ]];
603
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceCache ]];
600
604
XCTAssertEqual (snapshot.count , 0 );
601
605
XCTAssertEqual (snapshot.documentChanges .count , 0 );
602
606
XCTAssertTrue (snapshot.metadata .fromCache );
@@ -608,7 +612,8 @@ - (void)testGetNonExistingDocWhileOnlineServerOnly {
608
612
609
613
// get doc and ensure that it does not exist and is *not* from the cache.
610
614
FIRDocumentSnapshot *snapshot =
611
- [self readDocumentForRef: doc options: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer]];
615
+ [self readDocumentForRef: doc
616
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer]];
612
617
XCTAssertFalse (snapshot.exists );
613
618
XCTAssertFalse (snapshot.metadata .fromCache );
614
619
XCTAssertFalse (snapshot.metadata .hasPendingWrites );
@@ -620,7 +625,7 @@ - (void)testGetNonExistingCollectionWhileOnlineServerOnly {
620
625
// get collection and ensure that it's empty and that it's *not* from the cache.
621
626
FIRQuerySnapshot *snapshot =
622
627
[self readDocumentSetForRef: col
623
- options: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]];
628
+ options: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]];
624
629
XCTAssertEqual (snapshot.count , 0 );
625
630
XCTAssertEqual (snapshot.documentChanges .count , 0 );
626
631
XCTAssertFalse (snapshot.metadata .fromCache );
@@ -638,7 +643,7 @@ - (void)testGetNonExistingDocWhileOfflineServerOnly {
638
643
// certain documents *don't* exist.
639
644
XCTestExpectation *getNonExistingDocCompletion =
640
645
[self expectationWithDescription: @" getNonExistingDoc" ];
641
- [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
646
+ [doc getDocumentWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
642
647
completion: ^(FIRDocumentSnapshot *snapshot, NSError *error) {
643
648
XCTAssertNotNil (error);
644
649
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
@@ -656,7 +661,7 @@ - (void)testGetNonExistingCollectionWhileOfflineServerOnly {
656
661
657
662
// attempt to get collection and ensure that it cannot be retreived
658
663
XCTestExpectation *failedGetDocsCompletion = [self expectationWithDescription: @" failedGetDocs" ];
659
- [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRSourceServer ]
664
+ [col getDocumentsWithOptions: [[FIRGetOptions alloc ] initWithSource: FIRGetSourceServer ]
660
665
completion: ^(FIRQuerySnapshot *snapshot, NSError *error) {
661
666
XCTAssertNotNil (error);
662
667
XCTAssertEqualObjects (error.domain , FIRFirestoreErrorDomain);
0 commit comments