SwiftLint fixes. (#2899)
non_optional_string_data_conversion and static_over_final_class * Revert Data -> String changes for upcoming rule change.
This commit is contained in:
@@ -170,7 +170,7 @@ class KeychainControllerTests: XCTestCase {
|
||||
XCTAssertNil(keychain.pinCodeBiometricState(), "A new keychain shouldn't return biometric state.")
|
||||
|
||||
// When setting the state.
|
||||
let data: Data! = "Face ID".data(using: .utf8)
|
||||
let data = Data("Face ID".utf8)
|
||||
try keychain.setPINCodeBiometricState(data)
|
||||
|
||||
// Then the state should be stored.
|
||||
@@ -180,13 +180,13 @@ class KeychainControllerTests: XCTestCase {
|
||||
|
||||
func testUpdatePINCodeBiometricState() throws {
|
||||
// Given a keychain that contains PIN code biometric state.
|
||||
let data: Data! = "😃".data(using: .utf8)
|
||||
let data = Data("😃".utf8)
|
||||
try keychain.setPINCodeBiometricState(data)
|
||||
XCTAssertTrue(keychain.containsPINCodeBiometricState(), "The keychain should contain the biometric state.")
|
||||
XCTAssertEqual(keychain.pinCodeBiometricState(), data, "The stored biometric state should match what was set.")
|
||||
|
||||
// When setting different state.
|
||||
let newData: Data! = "😎".data(using: .utf8)
|
||||
let newData = Data("😎".utf8)
|
||||
try keychain.setPINCodeBiometricState(newData)
|
||||
|
||||
// Then the state should be updated.
|
||||
@@ -197,7 +197,7 @@ class KeychainControllerTests: XCTestCase {
|
||||
|
||||
func testRemovePINCodeBiometricState() throws {
|
||||
// Given a keychain that contains PIN code biometric state.
|
||||
let data: Data! = "Face ID".data(using: .utf8)
|
||||
let data = Data("Face ID".utf8)
|
||||
try keychain.setPINCodeBiometricState(data)
|
||||
XCTAssertTrue(keychain.containsPINCodeBiometricState(), "The keychain should contain the biometric state.")
|
||||
XCTAssertEqual(keychain.pinCodeBiometricState(), data, "The stored biometric state should match what was set.")
|
||||
|
||||
Reference in New Issue
Block a user