metatext/ServiceLayer/Sources/ServiceLayerMocks/MockAppEnvironment.swift

22 lines
624 B
Swift
Raw Normal View History

2020-09-01 07:33:49 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
2020-09-03 03:28:34 +00:00
import DB
2020-08-31 10:21:01 +00:00
import Foundation
import HTTP
2020-09-04 00:54:05 +00:00
import MockKeychain
2020-08-31 18:57:02 +00:00
import ServiceLayer
2020-08-31 10:21:01 +00:00
import Stubbing
2020-08-31 18:57:02 +00:00
public extension AppEnvironment {
2020-09-01 07:33:49 +00:00
static func mock(identityFixture: IdentityFixture? = nil) -> Self {
AppEnvironment(
session: Session(configuration: .stubbing),
webAuthSessionType: SuccessfulMockWebAuthSession.self,
2020-09-04 00:54:05 +00:00
keychain: MockKeychain.self,
2020-09-01 07:33:49 +00:00
userDefaults: MockUserDefaults(),
userNotificationClient: .mock,
inMemoryContent: true,
identityFixture: identityFixture)
}
2020-08-31 10:21:01 +00:00
}