1717#import < Security/Security.h>
1818#import < XCTest/XCTest.h>
1919
20- #import " FIRAuthKeychain .h"
20+ #import " FIRAuthKeychainServices .h"
2121
2222/* * @var kAccountPrefix
2323 @brief The keychain account prefix assumed by the tests.
@@ -98,7 +98,7 @@ @implementation FIRAuthKeychainTests
9898- (void )testReadNonexisting {
9999 [self setPassword: nil account: accountFromKey (kKey ) service: kService ];
100100 [self setPassword: nil account: kKey service: nil ]; // legacy form
101- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
101+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
102102 NSError *error = fakeError ();
103103 XCTAssertNil ([keychain dataForKey: kKey error: &error]);
104104 XCTAssertNil (error);
@@ -109,7 +109,7 @@ - (void)testReadNonexisting {
109109 */
110110- (void )testReadExisting {
111111 [self setPassword: kData account: accountFromKey (kKey ) service: kService ];
112- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
112+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
113113 NSError *error = fakeError ();
114114 XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
115115 XCTAssertNil (error);
@@ -122,7 +122,7 @@ - (void)testReadExisting {
122122- (void )testNotReadOtherService {
123123 [self setPassword: nil account: accountFromKey (kKey ) service: kService ];
124124 [self setPassword: kData account: accountFromKey (kKey ) service: kOtherService ];
125- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
125+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
126126 NSError *error = fakeError ();
127127 XCTAssertNil ([keychain dataForKey: kKey error: &error]);
128128 XCTAssertNil (error);
@@ -134,7 +134,7 @@ - (void)testNotReadOtherService {
134134 */
135135- (void )testWriteNonexisting {
136136 [self setPassword: nil account: accountFromKey (kKey ) service: kService ];
137- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
137+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
138138 XCTAssertTrue ([keychain setData: dataFromString (kData ) forKey: kKey error: NULL ]);
139139 XCTAssertEqualObjects ([self passwordWithAccount: accountFromKey (kKey ) service: kService ], kData );
140140 [self deletePasswordWithAccount: accountFromKey (kKey ) service: kService ];
@@ -145,7 +145,7 @@ - (void)testWriteNonexisting {
145145 */
146146- (void )testWriteExisting {
147147 [self setPassword: kData account: accountFromKey (kKey ) service: kService ];
148- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
148+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
149149 XCTAssertTrue ([keychain setData: dataFromString (kOtherData ) forKey: kKey error: NULL ]);
150150 XCTAssertEqualObjects ([self passwordWithAccount: accountFromKey (kKey ) service: kService ],
151151 kOtherData );
@@ -157,7 +157,7 @@ - (void)testWriteExisting {
157157 */
158158- (void )testDeleteNonexisting {
159159 [self setPassword: nil account: accountFromKey (kKey ) service: kService ];
160- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
160+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
161161 XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
162162 XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
163163}
@@ -167,7 +167,7 @@ - (void)testDeleteNonexisting {
167167 */
168168- (void )testDeleteExisting {
169169 [self setPassword: kData account: accountFromKey (kKey ) service: kService ];
170- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
170+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
171171 XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
172172 XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
173173}
@@ -178,7 +178,7 @@ - (void)testDeleteExisting {
178178- (void )testReadLegacy {
179179 [self setPassword: nil account: accountFromKey (kKey ) service: kService ];
180180 [self setPassword: kData account: kKey service: nil ]; // legacy form
181- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
181+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
182182 NSError *error = fakeError ();
183183 XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
184184 XCTAssertNil (error);
@@ -194,7 +194,7 @@ - (void)testReadLegacy {
194194- (void )testNotReadLegacy {
195195 [self setPassword: kData account: accountFromKey (kKey ) service: kService ];
196196 [self setPassword: kOtherData account: kKey service: nil ]; // legacy form
197- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
197+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
198198 NSError *error = fakeError ();
199199 XCTAssertEqualObjects ([keychain dataForKey: kKey error: &error], dataFromString (kData ));
200200 XCTAssertNil (error);
@@ -211,7 +211,7 @@ - (void)testNotReadLegacy {
211211- (void )testRemoveLegacy {
212212 [self setPassword: kData account: accountFromKey (kKey ) service: kService ];
213213 [self setPassword: kOtherData account: kKey service: nil ]; // legacy form
214- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
214+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
215215 XCTAssertTrue ([keychain removeDataForKey: kKey error: NULL ]);
216216 XCTAssertNil ([self passwordWithAccount: accountFromKey (kKey ) service: kService ]);
217217 XCTAssertNil ([self passwordWithAccount: kKey service: nil ]);
@@ -221,7 +221,7 @@ - (void)testRemoveLegacy {
221221 @brief Tests that 'NULL' can be safely passed in.
222222 */
223223- (void )testNullErrorParameter {
224- FIRAuthKeychain *keychain = [[FIRAuthKeychain alloc ] initWithService: kService ];
224+ FIRAuthKeychainServices *keychain = [[FIRAuthKeychainServices alloc ] initWithService: kService ];
225225 [keychain dataForKey: kKey error: NULL ];
226226 [keychain setData: dataFromString (kData ) forKey: kKey error: NULL ];
227227 [keychain removeDataForKey: kKey error: NULL ];
0 commit comments