@@ -20,7 +20,7 @@ struct AuthSessionRepositoryImplTests {
2020 let preference = makePreferenceResponse ( )
2121 let authService = AuthSessionAuthServiceSpy ( )
2222 let todoCategoryService = AuthSessionTodoCategoryServiceSpy ( preferences: [ preference] )
23- let store = AuthSessionUserDefaultsStoreSpy ( )
23+ let store = AuthSessionMemoryCacheStoreSpy ( )
2424 let provider = AuthSessionStateProviderSpy ( )
2525 let repository = AuthSessionRepositoryImpl (
2626 authService: authService,
@@ -48,7 +48,7 @@ struct AuthSessionRepositoryImplTests {
4848 let preference = makePreferenceResponse ( )
4949 let authService = AuthSessionAuthServiceSpy ( isSignedIn: true )
5050 let todoCategoryService = AuthSessionTodoCategoryServiceSpy ( preferences: [ preference] )
51- let store = AuthSessionUserDefaultsStoreSpy ( )
51+ let store = AuthSessionMemoryCacheStoreSpy ( )
5252 let provider = AuthSessionStateProviderSpy ( )
5353 store. setValue ( [ preference] , forKey: Key . preferences)
5454 let repository = AuthSessionRepositoryImpl (
@@ -153,7 +153,7 @@ private actor AuthSessionTodoCategoryServiceSpy: TodoCategoryService {
153153 }
154154}
155155
156- private final class AuthSessionUserDefaultsStoreSpy : UserDefaultsStore {
156+ private final class AuthSessionMemoryCacheStoreSpy : MemoryCacheStore {
157157 private var values = [ String: Data] ( )
158158
159159 func value< T: Codable > ( forKey key: String ) -> T ? {
@@ -172,28 +172,4 @@ private final class AuthSessionUserDefaultsStoreSpy: UserDefaultsStore {
172172
173173 values [ key] = try ? JSONEncoder ( ) . encode ( value)
174174 }
175-
176- func removeValues( withPrefix prefix: String ) {
177- values. keys
178- . filter { $0. hasPrefix ( prefix) }
179- . forEach { values. removeValue ( forKey: $0) }
180- }
181-
182- func string( forKey key: String ) -> String ? {
183- nil
184- }
185-
186- func setString( _ value: String ? , forKey key: String ) { }
187-
188- func stringArray( forKey key: String ) -> [ String ] {
189- [ ]
190- }
191-
192- func setStringArray( _ value: [ String ] , forKey key: String ) { }
193-
194- func bool( forKey key: String ) -> Bool {
195- false
196- }
197-
198- func setBool( _ value: Bool , forKey key: String ) { }
199175}
0 commit comments