metatext/Development Assets/FakeKeychain.swift

22 lines
431 B
Swift
Raw Normal View History

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