2022-11-17 03:25:55 -08:00
|
|
|
//
|
|
|
|
// UserPreferencesStorageMocks.swift
|
|
|
|
// secant-testnet
|
|
|
|
//
|
|
|
|
// Created by Lukáš Korba on 15.11.2022.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
2023-02-15 13:18:18 -08:00
|
|
|
import ComposableArchitecture
|
|
|
|
|
|
|
|
extension UserPreferencesStorageClient: TestDependencyKey {
|
2023-06-01 07:05:35 -07:00
|
|
|
public static var testValue = {
|
2023-02-15 13:18:18 -08:00
|
|
|
let mock = UserPreferencesStorage.mock
|
|
|
|
|
|
|
|
return UserPreferencesStorageClient(
|
|
|
|
activeAppSessionFrom: { mock.activeAppSessionFrom },
|
|
|
|
setActiveAppSessionFrom: mock.setActiveAppSessionFrom(_:),
|
|
|
|
currency: { mock.currency },
|
|
|
|
setCurrenty: mock.setCurrency(_:),
|
|
|
|
isFiatConverted: { mock.isFiatConverted },
|
|
|
|
setIsFiatConverted: mock.setIsFiatConverted(_:),
|
|
|
|
isRecoveryPhraseTestCompleted: {
|
|
|
|
mock.isRecoveryPhraseTestCompleted
|
|
|
|
},
|
|
|
|
setIsRecoveryPhraseTestCompleted: mock.setIsRecoveryPhraseTestCompleted(_:),
|
|
|
|
isSessionAutoshielded: { mock.isSessionAutoshielded },
|
|
|
|
setIsSessionAutoshielded: mock.setIsSessionAutoshielded(_:),
|
|
|
|
isUserOptedOutOfCrashReporting: {
|
|
|
|
mock.isUserOptedOutOfCrashReporting
|
|
|
|
},
|
|
|
|
setIsUserOptedOutOfCrashReporting: mock.setIsUserOptedOutOfCrashReporting(_:),
|
|
|
|
removeAll: mock.removeAll
|
|
|
|
)
|
|
|
|
}()
|
|
|
|
}
|
2022-11-17 03:25:55 -08:00
|
|
|
|
|
|
|
extension UserPreferencesStorage {
|
2023-06-01 07:05:35 -07:00
|
|
|
public static let mock = UserPreferencesStorage(
|
2022-11-17 03:25:55 -08:00
|
|
|
appSessionFrom: 1651039606.0,
|
|
|
|
convertedCurrency: "USD",
|
|
|
|
fiatConvertion: true,
|
|
|
|
recoveryPhraseTestCompleted: false,
|
|
|
|
sessionAutoshielded: true,
|
2023-02-15 13:18:18 -08:00
|
|
|
userOptedOutOfCrashReporting: false,
|
2022-11-17 03:25:55 -08:00
|
|
|
userDefaults: .noOp
|
|
|
|
)
|
|
|
|
}
|