17
17
#import < Security/Security.h>
18
18
#import < XCTest/XCTest.h>
19
19
20
- #import " FIRAuthKeychain .h"
20
+ #import " FIRAuthKeychainServices .h"
21
21
22
22
/* * @var kAccountPrefix
23
23
@brief The keychain account prefix assumed by the tests.
@@ -98,7 +98,7 @@ @implementation FIRAuthKeychainTests
98
98
- (void )testReadNonexisting {
99
99
[self setPassword: nil account: accountFromKey (kKey ) service: kService ];
100
100
[self setPassword: nil account: kKey service: nil ]; // legacy form
101
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
101
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
102
102
NSError *error = fakeError ();
103
103
XCTAssertNil ([keychain dataForKey: kKey error: &error]);
104
104
XCTAssertNil (error);
@@ -109,7 +109,7 @@ - (void)testReadNonexisting {
109
109
*/
110
110
- (void )testReadExisting {
111
111
[self setPassword: kData account: accountFromKey (kKey ) service: kService ];
112
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
112
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
113
113
NSError *error = fakeError ();
114
114
XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
115
115
XCTAssertNil (error);
@@ -122,7 +122,7 @@ - (void)testReadExisting {
122
122
- (void )testNotReadOtherService {
123
123
[self setPassword: nil account: accountFromKey (kKey ) service: kService ];
124
124
[self setPassword: kData account: accountFromKey (kKey ) service: kOtherService ];
125
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
125
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
126
126
NSError *error = fakeError ();
127
127
XCTAssertNil ([keychain dataForKey: kKey error: &error]);
128
128
XCTAssertNil (error);
@@ -134,7 +134,7 @@ - (void)testNotReadOtherService {
134
134
*/
135
135
- (void )testWriteNonexisting {
136
136
[self setPassword: nil account: accountFromKey (kKey ) service: kService ];
137
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
137
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
138
138
XCTAssertTrue ([keychain setData: dataFromString (kData ) forKey: kKey error: NULL ]);
139
139
XCTAssertEqualObjects ([self passwordWithAccount: accountFromKey (kKey ) service: kService ], kData );
140
140
[self deletePasswordWithAccount: accountFromKey (kKey ) service: kService ];
@@ -145,7 +145,7 @@ - (void)testWriteNonexisting {
145
145
*/
146
146
- (void )testWriteExisting {
147
147
[self setPassword: kData account: accountFromKey (kKey ) service: kService ];
148
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
148
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
149
149
XCTAssertTrue ([keychain setData: dataFromString (kOtherData ) forKey: kKey error: NULL ]);
150
150
XCTAssertEqualObjects ([self passwordWithAccount: accountFromKey (kKey ) service: kService ],
151
151
kOtherData );
@@ -157,7 +157,7 @@ - (void)testWriteExisting {
157
157
*/
158
158
- (void )testDeleteNonexisting {
159
159
[self setPassword: nil account: accountFromKey (kKey ) service: kService ];
160
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
160
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
161
161
XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
162
162
XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
163
163
}
@@ -167,7 +167,7 @@ - (void)testDeleteNonexisting {
167
167
*/
168
168
- (void )testDeleteExisting {
169
169
[self setPassword: kData account: accountFromKey (kKey ) service: kService ];
170
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
170
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
171
171
XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
172
172
XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
173
173
}
@@ -178,7 +178,7 @@ - (void)testDeleteExisting {
178
178
- (void )testReadLegacy {
179
179
[self setPassword: nil account: accountFromKey (kKey ) service: kService ];
180
180
[self setPassword: kData account: kKey service: nil ]; // legacy form
181
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
181
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
182
182
NSError *error = fakeError ();
183
183
XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
184
184
XCTAssertNil (error);
@@ -194,7 +194,7 @@ - (void)testReadLegacy {
194
194
- (void )testNotReadLegacy {
195
195
[self setPassword: kData account: accountFromKey (kKey ) service: kService ];
196
196
[self setPassword: kOtherData account: kKey service: nil ]; // legacy form
197
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
197
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
198
198
NSError *error = fakeError ();
199
199
XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
200
200
XCTAssertNil (error);
@@ -211,7 +211,7 @@ - (void)testNotReadLegacy {
211
211
- (void )testRemoveLegacy {
212
212
[self setPassword: kData account: accountFromKey (kKey ) service: kService ];
213
213
[self setPassword: kOtherData account: kKey service: nil ]; // legacy form
214
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
214
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
215
215
XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
216
216
XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
217
217
XCTAssertNil ([self passwordWithAccount: kKey service: nil ]);
@@ -221,7 +221,7 @@ - (void)testRemoveLegacy {
221
221
@brief Tests that 'NULL' can be safely passed in.
222
222
*/
223
223
- (void )testNullErrorParameter {
224
- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
224
+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
225
225
[keychain dataForKey: kKey error: NULL ];
226
226
[keychain setData: dataFromString (kData ) forKey: kKey error: NULL ];
227
227
[keychain removeDataForKey: kKey error: NULL ];
0 commit comments