mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-29 11:31:02 +00:00
31 lines
1.2 KiB
Swift
31 lines
1.2 KiB
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import DB
|
|
import Foundation
|
|
import HTTP
|
|
import Keychain
|
|
import MockKeychain
|
|
import ServiceLayer
|
|
import Stubbing
|
|
|
|
public extension AppEnvironment {
|
|
static func mock(session: URLSession = URLSession(configuration: .stubbing),
|
|
webAuthSessionType: WebAuthSession.Type = SuccessfulMockWebAuthSession.self,
|
|
keychain: Keychain.Type = MockKeychain.self,
|
|
userDefaults: UserDefaults = MockUserDefaults(),
|
|
userNotificationClient: UserNotificationClient = .mock,
|
|
uuid: @escaping () -> UUID = UUID.init,
|
|
inMemoryContent: Bool = true,
|
|
fixtureDatabase: IdentityDatabase? = nil) -> Self {
|
|
AppEnvironment(
|
|
session: session,
|
|
webAuthSessionType: webAuthSessionType,
|
|
keychain: keychain,
|
|
userDefaults: userDefaults,
|
|
userNotificationClient: userNotificationClient,
|
|
reduceMotion: { false },
|
|
uuid: uuid,
|
|
inMemoryContent: inMemoryContent,
|
|
fixtureDatabase: fixtureDatabase)
|
|
}
|
|
}
|