mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Tidy up mock creation. (#5627)
* Use our standard XYZMock(.init()) pattern everywhere instead of XYZMock.default. * Remove the configuration parameter label on mock convenience inits. * Update the enterprise submodule.
This commit is contained in:
@@ -9,18 +9,22 @@
|
||||
import UIKit
|
||||
|
||||
extension AppMediatorMock {
|
||||
static var `default`: AppMediatorMock {
|
||||
let mock = AppMediatorMock()
|
||||
struct Configuration {
|
||||
var appState = UIApplication.State.active
|
||||
var isCameraAuthorized = true
|
||||
var networkMonitor = NetworkMonitorMock(.init())
|
||||
}
|
||||
|
||||
convenience init(_ configuration: Configuration) {
|
||||
self.init()
|
||||
|
||||
mock.underlyingAppState = .active
|
||||
mock.requestAuthorizationIfNeededUnderlyingReturnValue = true
|
||||
mock.underlyingNetworkMonitor = NetworkMonitorMock.default
|
||||
underlyingAppState = configuration.appState
|
||||
requestAuthorizationIfNeededUnderlyingReturnValue = configuration.isCameraAuthorized
|
||||
underlyingNetworkMonitor = configuration.networkMonitor
|
||||
|
||||
let windowManagerMock = WindowManagerMock()
|
||||
windowManagerMock.closeAllSecondaryWindowsClosure = { }
|
||||
windowManagerMock.closeSecondaryWindowForTypeClosure = { _ in }
|
||||
mock.underlyingWindowManager = windowManagerMock
|
||||
|
||||
return mock
|
||||
underlyingWindowManager = windowManagerMock
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user