Skip to content

Instantly share code, notes, and snippets.

@piotrbernad
Created September 28, 2017 10:33
Show Gist options
  • Save piotrbernad/257041f66818c6f50b2b92a096d707a0 to your computer and use it in GitHub Desktop.
Save piotrbernad/257041f66818c6f50b2b92a096d707a0 to your computer and use it in GitHub Desktop.
MockedKeychain
public class MockedKeychain: KeychainAccess {
public var data: [String: Data] = [:]
public func remove(_ key: String) throws {
_ = data.removeValue(forKey: key)
}
public func set(_ value: Data, key: String) throws {
data[key] = value
}
public func get(_ key: String) throws -> Data? {
return data[key]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment