Update MockingKit invokation code
This commit is contained in:
parent
a7e4653ab0
commit
139578e442
|
@ -102,14 +102,14 @@ private class TestClass: BiometricAuthenticationService, Mockable {
|
|||
var authError: Error?
|
||||
|
||||
override func canAuthenticateUser(for auth: Authentication) -> Bool {
|
||||
invoke(canAuthenticateUserRef, args: (auth))
|
||||
call(canAuthenticateUserRef, args: (auth))
|
||||
}
|
||||
|
||||
override func performAuthentication(
|
||||
for auth: Authentication,
|
||||
reason: String,
|
||||
completion: @escaping AuthCompletion) {
|
||||
invoke(performAuthenticationRef, args: (auth, reason, completion))
|
||||
call(performAuthenticationRef, args: (auth, reason, completion))
|
||||
if let error = authError { return completion(.failure(error)) }
|
||||
completion(.success(()))
|
||||
}
|
||||
|
|
|
@ -17,12 +17,12 @@ class MockAuthenticationService: Mock, AuthenticationService {
|
|||
var authError: Error?
|
||||
|
||||
func authenticateUser(for auth: Authentication, reason: String, completion: @escaping AuthCompletion) {
|
||||
invoke(authenticateUserRef, args: (auth, reason, completion))
|
||||
call(authenticateUserRef, args: (auth, reason, completion))
|
||||
if let error = authError { return completion(.failure(error)) }
|
||||
completion(.success(()))
|
||||
}
|
||||
|
||||
func canAuthenticateUser(for auth: Authentication) -> Bool {
|
||||
invoke(canAuthenticateUserRef, args: (auth))
|
||||
call(canAuthenticateUserRef, args: (auth))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@ class MockDeviceIdentifier: Mock, DeviceIdentifier {
|
|||
lazy var getDeviceIdentifierRef = MockReference(getDeviceIdentifier)
|
||||
|
||||
func getDeviceIdentifier() -> String {
|
||||
invoke(getDeviceIdentifierRef, args: ())
|
||||
call(getDeviceIdentifierRef, args: ())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class MockKeychainService: KeychainService, Mockable {
|
|||
func set(_ value: String, for key: String, with accessibility: KeychainItemAccessibility?) -> Bool {
|
||||
mock.registerResult(for: stringRef) { _, _ in value }
|
||||
mock.registerResult(for: setStringRef) { _, _, _ in true }
|
||||
_ = mock.invoke(self.setStringRef, args: (value, key, accessibility))
|
||||
_ = mock.call(self.setStringRef, args: (value, key, accessibility))
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue