17
17
#import < XCTest/XCTest.h>
18
18
19
19
#import " FIRCLSUserDefaults.h"
20
- #import " FIRMockInstanceID .h"
20
+ #import " FIRMockInstallations .h"
21
21
22
22
static NSString *const FABInstallationUUIDKey = @" com.crashlytics.iuuid" ;
23
23
static NSString *const FABInstallationADIDKey = @" com.crashlytics.install.adid" ;
@@ -66,21 +66,21 @@ - (BOOL)blockOnRegeneration:(FIRCLSInstallIdentifierModel *)model {
66
66
}
67
67
68
68
- (void )testCreateUUID {
69
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
69
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
70
70
71
71
FIRCLSInstallIdentifierModel *model =
72
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
72
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
73
73
XCTAssertNotNil (model.installID );
74
74
75
75
XCTAssertEqualObjects ([_defaults objectForKey: FABInstallationUUIDKey], model.installID );
76
76
XCTAssertNil ([_defaults objectForKey: FABInstallationADIDKey]);
77
77
}
78
78
79
79
- (void )testCreateUUIDAndRotate {
80
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
80
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
81
81
82
82
FIRCLSInstallIdentifierModel *model =
83
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
83
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
84
84
XCTAssertNotNil (model.installID );
85
85
86
86
BOOL didRotate = [self blockOnRegeneration: model];
@@ -94,10 +94,10 @@ - (void)testCreateUUIDAndRotate {
94
94
95
95
- (void )testCreateUUIDAndErrorGettingInstanceID {
96
96
NSError *fakeError = [NSError errorWithDomain: NSCocoaErrorDomain code: -1 userInfo: @{}];
97
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithError: fakeError];
97
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithError: fakeError];
98
98
99
99
FIRCLSInstallIdentifierModel *model =
100
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
100
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
101
101
XCTAssertNotNil (model.installID );
102
102
103
103
BOOL didRotate = [self blockOnRegeneration: model];
@@ -109,10 +109,10 @@ - (void)testCreateUUIDAndErrorGettingInstanceID {
109
109
}
110
110
111
111
- (void )testCreateUUIDNoIID {
112
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :nil ];
112
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :nil ];
113
113
114
114
FIRCLSInstallIdentifierModel *model =
115
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
115
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
116
116
XCTAssertNotNil (model.installID );
117
117
118
118
XCTAssertEqualObjects ([_defaults objectForKey: FABInstallationUUIDKey], model.installID );
@@ -126,9 +126,9 @@ - (void)testIIDBecomesNil {
126
126
[_defaults setObject: @" old_instance_id" forKey: FIRCLSInstallationIIDHashKey];
127
127
128
128
// Initialize the model with the a nil IID.
129
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :nil ];
129
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :nil ];
130
130
FIRCLSInstallIdentifierModel *model =
131
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
131
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
132
132
XCTAssertNotNil (model.installID );
133
133
134
134
// Test that the UUID did not change. The FIID can be nil if
@@ -144,9 +144,9 @@ - (void)testIIDChanges {
144
144
[_defaults setObject: @" old_instance_id" forKey: FIRCLSInstallationIIDHashKey];
145
145
146
146
// Initialize the model with the a new IID.
147
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" new_instance_id" ];
147
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" new_instance_id" ];
148
148
FIRCLSInstallIdentifierModel *model =
149
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
149
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
150
150
XCTAssertNotNil (model.installID );
151
151
152
152
BOOL didRotate = [self blockOnRegeneration: model];
@@ -166,9 +166,9 @@ - (void)testIIDDoesntChange {
166
166
[_defaults setObject: FIRCLSTestHashOfTestInstanceID forKey: FIRCLSInstallationIIDHashKey];
167
167
168
168
// Initialize the model with the a new IID.
169
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
169
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
170
170
FIRCLSInstallIdentifierModel *model =
171
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
171
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
172
172
XCTAssertNotNil (model.installID );
173
173
174
174
BOOL didRotate = [self blockOnRegeneration: model];
@@ -187,9 +187,9 @@ - (void)testUUIDSetButNeverIIDNilIID {
187
187
[_defaults setObject: @" old_uuid" forKey: FABInstallationUUIDKey];
188
188
189
189
// Initialize the model with the a nil IID.
190
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :nil ];
190
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :nil ];
191
191
FIRCLSInstallIdentifierModel *model =
192
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
192
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
193
193
XCTAssertNotNil (model.installID );
194
194
195
195
BOOL didRotate = [self blockOnRegeneration: model];
@@ -208,9 +208,9 @@ - (void)testUUIDSetButNeverIIDWithIID {
208
208
[_defaults setObject: @" old_uuid" forKey: FABInstallationUUIDKey];
209
209
210
210
// Initialize the model with the a nil IID.
211
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
211
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
212
212
FIRCLSInstallIdentifierModel *model =
213
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
213
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
214
214
XCTAssertNotNil (model.installID );
215
215
216
216
BOOL didRotate = [self blockOnRegeneration: model];
@@ -231,9 +231,9 @@ - (void)testADIDWasSetButNeverIID {
231
231
[_defaults setObject: @" test_adid" forKey: FABInstallationADIDKey];
232
232
233
233
// Initialize the model with the a new IID.
234
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :nil ];
234
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :nil ];
235
235
FIRCLSInstallIdentifierModel *model =
236
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
236
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
237
237
XCTAssertNotNil (model.installID );
238
238
239
239
BOOL didRotate = [self blockOnRegeneration: model];
@@ -252,9 +252,9 @@ - (void)testADIDWasSetAndIIDBecomesSet {
252
252
[_defaults setObject: @" test_adid" forKey: FABInstallationADIDKey];
253
253
254
254
// Initialize the model with the a new IID.
255
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
255
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
256
256
FIRCLSInstallIdentifierModel *model =
257
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
257
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
258
258
XCTAssertNotNil (model.installID );
259
259
260
260
BOOL didRotate = [self blockOnRegeneration: model];
@@ -275,9 +275,9 @@ - (void)testADIDAndIIDWereSet {
275
275
[_defaults setObject: FIRCLSTestHashOfTestInstanceID forKey: FIRCLSInstallationIIDHashKey];
276
276
277
277
// Initialize the model with the a new IID.
278
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID :@" test_instance_id" ];
278
+ FIRMockInstallations *iid = [[FIRMockInstallations alloc ] initWithFID :@" test_instance_id" ];
279
279
FIRCLSInstallIdentifierModel *model =
280
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
280
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
281
281
XCTAssertNotNil (model.installID );
282
282
283
283
BOOL didRotate = [self blockOnRegeneration: model];
@@ -298,9 +298,10 @@ - (void)testADIDAndIIDWereSet2 {
298
298
[_defaults setObject: FIRCLSTestHashOfTestInstanceID forKey: FIRCLSInstallationIIDHashKey];
299
299
300
300
// Initialize the model with the a new IID.
301
- FIRMockInstanceID *iid = [[FIRMockInstanceID alloc ] initWithIID: @" test_changed_instance_id" ];
301
+ FIRMockInstallations *iid =
302
+ [[FIRMockInstallations alloc ] initWithFID: @" test_changed_instance_id" ];
302
303
FIRCLSInstallIdentifierModel *model =
303
- [[FIRCLSInstallIdentifierModel alloc ] initWithInstanceID : iid];
304
+ [[FIRCLSInstallIdentifierModel alloc ] initWithInstallations : iid];
304
305
XCTAssertNotNil (model.installID );
305
306
306
307
BOOL didRotate = [self blockOnRegeneration: model];
0 commit comments