26
26
#include " Firestore/core/src/util/string_apple.h"
27
27
#include " Firestore/core/test/unit/testutil/bundle_builder.h"
28
28
29
- namespace testutil = firebase::firestore::testutil;
30
- namespace util = firebase::firestore::util;
29
+ using firebase::firestore::testutil::CreateBundle;
30
+ using firebase::firestore::util::MakeString;
31
+ using firebase::firestore::util::MakeNSString;
31
32
32
33
@interface FIRBundlesTests : FSTIntegrationTestCase
33
34
@end
@@ -67,11 +68,11 @@ - (void)verifyErrorProgress:(FIRLoadBundleTaskProgress*)progress {
67
68
}
68
69
69
70
- (std::string)defaultBundle {
70
- return testutil:: CreateBundle (util:: MakeString ([FSTIntegrationTestCase projectID ]));
71
+ return CreateBundle (MakeString ([FSTIntegrationTestCase projectID ]));
71
72
}
72
73
73
74
- (std::string)bundleForProject : (NSString *)projectID {
74
- return testutil:: CreateBundle (util:: MakeString (projectID));
75
+ return CreateBundle (MakeString (projectID));
75
76
}
76
77
77
78
- (void )verifyQueryResults {
@@ -115,7 +116,7 @@ - (void)testLoadWithDocumentsThatAreAlreadyPulledFromBackend {
115
116
__block FIRLoadBundleTaskProgress* result;
116
117
XCTestExpectation* expectation = [self expectationWithDescription: @" loading complete" ];
117
118
FIRLoadBundleTask* task =
118
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
119
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
119
120
completion: ^(FIRLoadBundleTaskProgress* progress, NSError * error) {
120
121
result = progress;
121
122
XCTAssertNil (error);
@@ -147,7 +148,7 @@ - (void)testLoadDocumentsWithProgressUpdates {
147
148
__block FIRLoadBundleTaskProgress* result;
148
149
XCTestExpectation* expectation = [self expectationWithDescription: @" loading complete" ];
149
150
FIRLoadBundleTask* task =
150
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
151
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
151
152
completion: ^(FIRLoadBundleTaskProgress* progress, NSError * error) {
152
153
result = progress;
153
154
XCTAssertNil (error);
@@ -171,14 +172,14 @@ - (void)testLoadDocumentsWithProgressUpdates {
171
172
172
173
- (void )testLoadForASecondTimeSkips {
173
174
auto bundle = [self defaultBundle ];
174
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]];
175
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]];
175
176
176
177
// Load for a second time
177
178
NSMutableArray * progresses = [[NSMutableArray alloc ] init ];
178
179
__block FIRLoadBundleTaskProgress* result;
179
180
XCTestExpectation* expectation = [self expectationWithDescription: @" loading complete" ];
180
181
FIRLoadBundleTask* task =
181
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
182
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
182
183
completion: ^(FIRLoadBundleTaskProgress* progress, NSError * error) {
183
184
result = progress;
184
185
XCTAssertNil (error);
@@ -205,7 +206,7 @@ - (void)testLoadedDocumentsShouldNotBeGarbageCollectedRightAway {
205
206
auto bundle = [self defaultBundle ];
206
207
__block FIRLoadBundleTaskProgress* result;
207
208
XCTestExpectation* expectation = [self expectationWithDescription: @" loading complete" ];
208
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
209
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
209
210
completion: ^(FIRLoadBundleTaskProgress* progress, NSError * error) {
210
211
result = progress;
211
212
XCTAssertNil (error);
@@ -229,7 +230,7 @@ - (void)testLoadBundlesFromOtherProjectFails {
229
230
XCTestExpectation* expectation = [self expectationWithDescription: @" loading complete" ];
230
231
auto bundle = [self bundleForProject: @" OtherProject" ];
231
232
FIRLoadBundleTask* task =
232
- [self .db loadBundle: [util:: MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
233
+ [self .db loadBundle: [MakeNSString (bundle) dataUsingEncoding: NSUTF8StringEncoding]
233
234
completion: ^(FIRLoadBundleTaskProgress* progress, NSError * error) {
234
235
result = progress;
235
236
XCTAssertNotNil (error);
0 commit comments