From 139578e4426295c3a46ea733a00036a6b62330c9 Mon Sep 17 00:00:00 2001 From: Daniel Saidi Date: Wed, 8 Sep 2021 10:37:03 +0200 Subject: [PATCH] Update MockingKit invokation code --- .../Authentication/BiometricAuthenticationServiceTests.swift | 4 ++-- .../Authentication/MockAuthenticationService.swift | 4 ++-- Tests/SwiftKitTests/Device/MockDeviceIdentifier.swift | 2 +- Tests/SwiftKitTests/Keychain/MockKeychainService.swift | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/SwiftKitTests/Authentication/BiometricAuthenticationServiceTests.swift b/Tests/SwiftKitTests/Authentication/BiometricAuthenticationServiceTests.swift index 2cad870..bf417b9 100644 --- a/Tests/SwiftKitTests/Authentication/BiometricAuthenticationServiceTests.swift +++ b/Tests/SwiftKitTests/Authentication/BiometricAuthenticationServiceTests.swift @@ -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(())) } diff --git a/Tests/SwiftKitTests/Authentication/MockAuthenticationService.swift b/Tests/SwiftKitTests/Authentication/MockAuthenticationService.swift index 20f4463..bc5896a 100644 --- a/Tests/SwiftKitTests/Authentication/MockAuthenticationService.swift +++ b/Tests/SwiftKitTests/Authentication/MockAuthenticationService.swift @@ -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)) } } diff --git a/Tests/SwiftKitTests/Device/MockDeviceIdentifier.swift b/Tests/SwiftKitTests/Device/MockDeviceIdentifier.swift index 4bf64bc..d5942b3 100644 --- a/Tests/SwiftKitTests/Device/MockDeviceIdentifier.swift +++ b/Tests/SwiftKitTests/Device/MockDeviceIdentifier.swift @@ -15,6 +15,6 @@ class MockDeviceIdentifier: Mock, DeviceIdentifier { lazy var getDeviceIdentifierRef = MockReference(getDeviceIdentifier) func getDeviceIdentifier() -> String { - invoke(getDeviceIdentifierRef, args: ()) + call(getDeviceIdentifierRef, args: ()) } } diff --git a/Tests/SwiftKitTests/Keychain/MockKeychainService.swift b/Tests/SwiftKitTests/Keychain/MockKeychainService.swift index b0ce0b5..efde3ca 100644 --- a/Tests/SwiftKitTests/Keychain/MockKeychainService.swift +++ b/Tests/SwiftKitTests/Keychain/MockKeychainService.swift @@ -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 } }