Introduce KeyStore protocol in order to provide specialized key store implementations for tests
With the DictBasedKeychain the main AppKeychain is not influenced by tests. The previous implementation led to an empty Keychain requiring a new setup of the simulator.
This commit is contained in:
parent
b42401343d
commit
5c7d4e55a4
6 changed files with 93 additions and 24 deletions
19
passKit/Helpers/KeyStore.swift
Normal file
19
passKit/Helpers/KeyStore.swift
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// KeyStore.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Danny Moesch on 20.07.19.
|
||||
// Copyright © 2019 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public protocol KeyStore {
|
||||
func add(data: Data?, for key: String)
|
||||
func add(string: String?, for key: String)
|
||||
func contains(key: String) -> Bool
|
||||
func get(for key: String) -> Data?
|
||||
func get(for key: String) -> String?
|
||||
func removeContent(for key: String)
|
||||
func removeAllContent()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue