2020-07-29 23:50:30 +00:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
2020-08-09 01:29:05 +00:00
|
|
|
class MockKeychainService {
|
|
|
|
private var guts = [String: Data]()
|
|
|
|
}
|
2020-07-29 23:50:30 +00:00
|
|
|
|
2020-08-09 01:29:05 +00:00
|
|
|
extension MockKeychainService: KeychainServiceType {
|
|
|
|
func set(data: Data, forKey key: String) throws {
|
|
|
|
guts[key] = data
|
2020-07-29 23:50:30 +00:00
|
|
|
}
|
|
|
|
|
2020-08-09 01:29:05 +00:00
|
|
|
func deleteData(key: String) throws {
|
|
|
|
guts[key] = nil
|
2020-07-29 23:50:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func getData(key: String) throws -> Data? {
|
2020-08-09 01:29:05 +00:00
|
|
|
guts[key]
|
2020-07-29 23:50:30 +00:00
|
|
|
}
|
|
|
|
}
|