aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Model/FSTMutationTests.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Example/Tests/Model/FSTMutationTests.mm')
-rw-r--r--Firestore/Example/Tests/Model/FSTMutationTests.mm21
1 files changed, 11 insertions, 10 deletions
diff --git a/Firestore/Example/Tests/Model/FSTMutationTests.mm b/Firestore/Example/Tests/Model/FSTMutationTests.mm
index 1c1375c..5b056fb 100644
--- a/Firestore/Example/Tests/Model/FSTMutationTests.mm
+++ b/Firestore/Example/Tests/Model/FSTMutationTests.mm
@@ -22,10 +22,13 @@
#import "Firestore/Source/Model/FSTDocument.h"
#import "Firestore/Source/Model/FSTDocumentKey.h"
#import "Firestore/Source/Model/FSTFieldValue.h"
-#import "Firestore/Source/Model/FSTPath.h"
#import "Firestore/Example/Tests/Util/FSTHelpers.h"
+#include "Firestore/core/test/firebase/firestore/testutil/testutil.h"
+
+namespace testutil = firebase::firestore::testutil;
+
@interface FSTMutationTests : XCTestCase
@end
@@ -52,8 +55,7 @@
NSDictionary *docData = @{ @"foo" : @{@"bar" : @"bar-value"}, @"baz" : @"baz-value" };
FSTDocument *baseDoc = FSTTestDoc(@"collection/key", 0, docData, NO);
- FSTMutation *patch =
- FSTTestPatchMutation(@"collection/key", @{@"foo.bar" : @"new-bar-value"}, nil);
+ FSTMutation *patch = FSTTestPatchMutation("collection/key", @{@"foo.bar" : @"new-bar-value"}, {});
FSTMaybeDocument *patchedDoc =
[patch applyTo:baseDoc baseDocument:baseDoc localWriteTime:_timestamp];
@@ -66,7 +68,7 @@
FSTDocument *baseDoc = FSTTestDoc(@"collection/key", 0, docData, NO);
FSTDocumentKey *key = FSTTestDocKey(@"collection/key");
- FSTFieldMask *mask = [[FSTFieldMask alloc] initWithFields:@[ FSTTestFieldPath(@"foo.bar") ]];
+ FSTFieldMask *mask = [[FSTFieldMask alloc] initWithFields:{testutil::Field("foo.bar")}];
FSTMutation *patch = [[FSTPatchMutation alloc] initWithKey:key
fieldMask:mask
value:[FSTObjectValue objectValue]
@@ -82,8 +84,7 @@
NSDictionary *docData = @{@"foo" : @"foo-value", @"baz" : @"baz-value"};
FSTDocument *baseDoc = FSTTestDoc(@"collection/key", 0, docData, NO);
- FSTMutation *patch =
- FSTTestPatchMutation(@"collection/key", @{@"foo.bar" : @"new-bar-value"}, nil);
+ FSTMutation *patch = FSTTestPatchMutation("collection/key", @{@"foo.bar" : @"new-bar-value"}, {});
FSTMaybeDocument *patchedDoc =
[patch applyTo:baseDoc baseDocument:baseDoc localWriteTime:_timestamp];
@@ -93,7 +94,7 @@
- (void)testPatchingDeletedDocumentsDoesNothing {
FSTMaybeDocument *baseDoc = FSTTestDeletedDoc(@"collection/key", 0);
- FSTMutation *patch = FSTTestPatchMutation(@"collection/key", @{@"foo" : @"bar"}, nil);
+ FSTMutation *patch = FSTTestPatchMutation("collection/key", @{@"foo" : @"bar"}, {});
FSTMaybeDocument *patchedDoc =
[patch applyTo:baseDoc baseDocument:baseDoc localWriteTime:_timestamp];
XCTAssertEqualObjects(patchedDoc, baseDoc);
@@ -115,7 +116,7 @@
[expectedData objectBySettingValue:[FSTServerTimestampValue
serverTimestampValueWithLocalWriteTime:_timestamp
previousValue:nil]
- forPath:FSTTestFieldPath(@"foo.bar")];
+ forPath:testutil::Field("foo.bar")];
FSTDocument *expectedDoc = [FSTDocument documentWithData:expectedData
key:FSTTestDocKey(@"collection/key")
@@ -176,7 +177,7 @@
NSDictionary *docData = @{@"foo" : @"bar"};
FSTDocument *baseDoc = FSTTestDoc(@"collection/key", 0, docData, NO);
- FSTMutation *patch = FSTTestPatchMutation(@"collection/key", @{@"foo" : @"new-bar"}, nil);
+ FSTMutation *patch = FSTTestPatchMutation("collection/key", @{@"foo" : @"new-bar"}, {});
FSTMutationResult *mutationResult =
[[FSTMutationResult alloc] initWithVersion:FSTTestVersion(4) transformResults:nil];
FSTMaybeDocument *patchedDoc = [patch applyTo:baseDoc
@@ -210,7 +211,7 @@
FSTDeletedDocument *deletedV3 = FSTTestDeletedDoc(@"collection/key", 3);
FSTMutation *setMutation = FSTTestSetMutation(@"collection/key", @{});
- FSTMutation *patchMutation = FSTTestPatchMutation(@"collection/key", @{}, nil);
+ FSTMutation *patchMutation = FSTTestPatchMutation("collection/key", {}, {});
FSTMutation *deleteMutation = FSTTestDeleteMutation(@"collection/key");
ASSERT_VERSION_TRANSITION(setMutation, docV3, docV3);