Refactor core data classes (#671)

This commit is contained in:
Mingshen Sun 2025-01-25 15:40:12 -08:00 committed by GitHub
parent ab453580ad
commit d1de81d919
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 605 additions and 433 deletions

View file

@ -11,7 +11,6 @@ import XCTest
@testable import passKit
let PASSWORD_PATH = "/path/to/password"
let PASSWORD_URL = URL(fileURLWithPath: "/path/to/password")
let PASSWORD_STRING = "abcd1234"
let TOTP_URL = "otpauth://totp/email@email.com?secret=abcd1234"
let STEAM_TOTP_URL = "otpauth://totp/username?secret=12345678901234567890&issuer=Steam&algorithm=SHA1&digits=5&period=30&representation=steamguard"
@ -30,8 +29,8 @@ let TOTP_URL_FIELD = "otpauth" => "//totp/email@email.com?secret=abcd1234"
let MULTILINE_BLOCK_START = "multiline block" => "|"
let MULTILINE_LINE_START = "multiline line" => ">"
func getPasswordObjectWith(content: String, url: URL? = nil) -> Password {
Password(name: "password", url: url ?? PASSWORD_URL, plainText: content)
func getPasswordObjectWith(content: String, path: String? = nil) -> Password {
Password(name: "password", path: path ?? PASSWORD_PATH, plainText: content)
}
func assertDefaults(