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