diff options
author | Konstantin Varlamov <var-const@users.noreply.github.com> | 2018-02-20 17:33:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-20 17:33:57 -0500 |
commit | 14ea068f5fd03a658017f8472a4078a727fabc3a (patch) | |
tree | 56696c49546e2147ec1b8ebdeba24dd292f0c951 /Firestore/Example/Tests/Model | |
parent | de00de25deebc35c4c7167135d5b1f29a7d9fe6f (diff) |
Make FSTTimestamp into a public Firestore class (#698)
- FSTTimestamp is now FIRTimestamp, under Firestore/Source/{Public,API}. This is a temporary solution; eventually, FIRTimestamp is supposed to live somewhere under Firebase;
- move most internal Timestamp methods to the public header (the only exception is ISOString).
Diffstat (limited to 'Firestore/Example/Tests/Model')
-rw-r--r-- | Firestore/Example/Tests/Model/FSTFieldValueTests.mm | 18 | ||||
-rw-r--r-- | Firestore/Example/Tests/Model/FSTMutationTests.mm | 6 |
2 files changed, 11 insertions, 13 deletions
diff --git a/Firestore/Example/Tests/Model/FSTFieldValueTests.mm b/Firestore/Example/Tests/Model/FSTFieldValueTests.mm index 52d5a4e..c0fb188 100644 --- a/Firestore/Example/Tests/Model/FSTFieldValueTests.mm +++ b/Firestore/Example/Tests/Model/FSTFieldValueTests.mm @@ -17,11 +17,11 @@ #import "Firestore/Source/Model/FSTFieldValue.h" #import <FirebaseFirestore/FIRGeoPoint.h> +#import <FirebaseFirestore/FIRTimestamp.h> #import <XCTest/XCTest.h> #import "Firestore/Source/API/FIRFirestore+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#import "Firestore/Source/Core/FSTTimestamp.h" #import "Firestore/Source/Model/FSTFieldValue.h" #import "Firestore/Source/Model/FSTPath.h" @@ -229,7 +229,7 @@ union DoubleBits { XCTAssertEqualObjects([wrapped value], value); XCTAssertEqualObjects(((FSTTimestampValue *)wrapped).internalValue, - [FSTTimestamp timestampWithDate:value]); + [FIRTimestamp timestampWithDate:value]); } } @@ -445,20 +445,20 @@ union DoubleBits { @[ FSTTestFieldValue(@"\u00e9a") ], // latin small letter e with acute accent @[ FSTTestFieldValue(date1), - [FSTTimestampValue timestampValue:[FSTTimestamp timestampWithDate:date1]] + [FSTTimestampValue timestampValue:[FIRTimestamp timestampWithDate:date1]] ], @[ FSTTestFieldValue(date2) ], @[ // NOTE: ServerTimestampValues can't be parsed via FSTTestFieldValue(). [FSTServerTimestampValue - serverTimestampValueWithLocalWriteTime:[FSTTimestamp timestampWithDate:date1] + serverTimestampValueWithLocalWriteTime:[FIRTimestamp timestampWithDate:date1] previousValue:nil], [FSTServerTimestampValue - serverTimestampValueWithLocalWriteTime:[FSTTimestamp timestampWithDate:date1] + serverTimestampValueWithLocalWriteTime:[FIRTimestamp timestampWithDate:date1] previousValue:nil] ], @[ [FSTServerTimestampValue - serverTimestampValueWithLocalWriteTime:[FSTTimestamp timestampWithDate:date2] + serverTimestampValueWithLocalWriteTime:[FIRTimestamp timestampWithDate:date2] previousValue:nil] ], @[ FSTTestFieldValue(FSTTestGeoPoint(0, 1)), @@ -574,14 +574,12 @@ union DoubleBits { { XCTAssertTrue([output[@"array"][1] isKindOfClass:[NSDate class]]); NSDate *actual = output[@"array"][1]; - XCTAssertEqualWithAccuracy(date.timeIntervalSince1970, actual.timeIntervalSince1970, - 0.000000001); + XCTAssertEqualWithAccuracy(date.timeIntervalSince1970, actual.timeIntervalSince1970, 0.000001); } { XCTAssertTrue([output[@"obj"][@"date"] isKindOfClass:[NSDate class]]); NSDate *actual = output[@"obj"][@"date"]; - XCTAssertEqualWithAccuracy(date.timeIntervalSince1970, actual.timeIntervalSince1970, - 0.000000001); + XCTAssertEqualWithAccuracy(date.timeIntervalSince1970, actual.timeIntervalSince1970, 0.000001); } } diff --git a/Firestore/Example/Tests/Model/FSTMutationTests.mm b/Firestore/Example/Tests/Model/FSTMutationTests.mm index 47fa9b3..1c1375c 100644 --- a/Firestore/Example/Tests/Model/FSTMutationTests.mm +++ b/Firestore/Example/Tests/Model/FSTMutationTests.mm @@ -16,9 +16,9 @@ #import "Firestore/Source/Model/FSTMutation.h" +#import <FirebaseFirestore/FIRTimestamp.h> #import <XCTest/XCTest.h> -#import "Firestore/Source/Core/FSTTimestamp.h" #import "Firestore/Source/Model/FSTDocument.h" #import "Firestore/Source/Model/FSTDocumentKey.h" #import "Firestore/Source/Model/FSTFieldValue.h" @@ -30,11 +30,11 @@ @end @implementation FSTMutationTests { - FSTTimestamp *_timestamp; + FIRTimestamp *_timestamp; } - (void)setUp { - _timestamp = [FSTTimestamp timestamp]; + _timestamp = [FIRTimestamp timestamp]; } - (void)testAppliesSetsToDocuments { |