Skip to content
Discussion options

You must be logged in to vote

Hey @saroar! testValue should return the same type as liveValue, and in your case, KeychainClientMock is not a KeychainClient. It could probably work using any KeychainProtocol instead. Another convenient approach would be to remove the KeychainProtocol and use this kind of construct:

struct KeychainClient {
  var save: @Sendable (_ data: Data, _ service: ServiceKeys, _ account: String) async throws
  var update: @Sendable (_ password: Data, _ service: ServiceKeys, _ account: String) async throws
  var read: @Sendable (_ service: ServiceKeys, _ account: String) throws -> Data
  var deletePassword: @Sendable (_ service: ServiceKeys, _ account: String) async throws
  
  func readCodable<T: C…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@saroar
Comment options

@saroar
Comment options

@tgrapperon
Comment options

@saroar
Comment options

@saroar
Comment options

Answer selected by saroar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants