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:
Doug
2024-06-05 07:31:49 +01:00
committed by GitHub
parent b122222858
commit dc42647740
7 changed files with 18 additions and 23 deletions

View File

@@ -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.")