metatext/ServiceLayer/Sources/ServiceLayerMocks/MockAppEnvironment.swift
Justin Mazzocchi 8229eecc3a
Refactoring
2020-09-08 18:02:55 -07:00

28 lines
1.1 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: Session = Session(configuration: .stubbing),
webAuthSessionType: WebAuthSession.Type = SuccessfulMockWebAuthSession.self,
keychain: Keychain.Type = MockKeychain.self,
userDefaults: UserDefaults = MockUserDefaults(),
userNotificationClient: UserNotificationClient = .mock,
inMemoryContent: Bool = true,
fixtureDatabase: IdentityDatabase? = nil) -> Self {
AppEnvironment(
session: Session(configuration: .stubbing),
webAuthSessionType: webAuthSessionType,
keychain: keychain,
userDefaults: userDefaults,
userNotificationClient: userNotificationClient,
inMemoryContent: inMemoryContent,
fixtureDatabase: fixtureDatabase)
}
}