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?
|
var authError: Error?
|
||||||
|
|
||||||
override func canAuthenticateUser(for auth: Authentication) -> Bool {
|
override func canAuthenticateUser(for auth: Authentication) -> Bool {
|
||||||
invoke(canAuthenticateUserRef, args: (auth))
|
call(canAuthenticateUserRef, args: (auth))
|
||||||
}
|
}
|
||||||
|
|
||||||
override func performAuthentication(
|
override func performAuthentication(
|
||||||
for auth: Authentication,
|
for auth: Authentication,
|
||||||
reason: String,
|
reason: String,
|
||||||
completion: @escaping AuthCompletion) {
|
completion: @escaping AuthCompletion) {
|
||||||
invoke(performAuthenticationRef, args: (auth, reason, completion))
|
call(performAuthenticationRef, args: (auth, reason, completion))
|
||||||
if let error = authError { return completion(.failure(error)) }
|
if let error = authError { return completion(.failure(error)) }
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,12 @@ class MockAuthenticationService: Mock, AuthenticationService {
|
||||||
var authError: Error?
|
var authError: Error?
|
||||||
|
|
||||||
func authenticateUser(for auth: Authentication, reason: String, completion: @escaping AuthCompletion) {
|
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)) }
|
if let error = authError { return completion(.failure(error)) }
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func canAuthenticateUser(for auth: Authentication) -> Bool {
|
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)
|
lazy var getDeviceIdentifierRef = MockReference(getDeviceIdentifier)
|
||||||
|
|
||||||
func getDeviceIdentifier() -> String {
|
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 {
|
func set(_ value: String, for key: String, with accessibility: KeychainItemAccessibility?) -> Bool {
|
||||||
mock.registerResult(for: stringRef) { _, _ in value }
|
mock.registerResult(for: stringRef) { _, _ in value }
|
||||||
mock.registerResult(for: setStringRef) { _, _, _ in true }
|
mock.registerResult(for: setStringRef) { _, _, _ in true }
|
||||||
_ = mock.invoke(self.setStringRef, args: (value, key, accessibility))
|
_ = mock.call(self.setStringRef, args: (value, key, accessibility))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue