|
|
@ -8,26 +8,26 @@ class LockEnterPasscodeCoordinatorTest: XCTestCase { |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
XCTAssertFalse(coordinator.protectionWasShown) |
|
|
|
XCTAssertTrue(coordinator.window.isHidden) |
|
|
|
coordinator.start() |
|
|
|
coordinator.start() |
|
|
|
XCTAssertTrue(coordinator.protectionWasShown) |
|
|
|
XCTAssertFalse(coordinator.window.isHidden) |
|
|
|
} |
|
|
|
} |
|
|
|
func testStop() { |
|
|
|
func testStop() { |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
XCTAssertFalse(coordinator.protectionWasShown) |
|
|
|
|
|
|
|
coordinator.start() |
|
|
|
coordinator.start() |
|
|
|
XCTAssertTrue(coordinator.protectionWasShown) |
|
|
|
XCTAssertFalse(coordinator.window.isHidden) |
|
|
|
coordinator.stop() |
|
|
|
coordinator.stop() |
|
|
|
|
|
|
|
XCTAssertTrue(coordinator.window.isHidden) |
|
|
|
} |
|
|
|
} |
|
|
|
func testDisableLock() { |
|
|
|
func testDisableLock() { |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let viewModel = LockEnterPasscodeViewModel() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
let fakeLock = FakeLockProtocol() |
|
|
|
fakeLock.passcodeSet = false |
|
|
|
fakeLock.passcodeSet = false |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
let coordinator = LockEnterPasscodeCoordinator(model: viewModel, lock: fakeLock) |
|
|
|
XCTAssertFalse(coordinator.protectionWasShown) |
|
|
|
XCTAssertTrue(coordinator.window.isHidden) |
|
|
|
coordinator.start() |
|
|
|
coordinator.start() |
|
|
|
XCTAssertFalse(coordinator.protectionWasShown) |
|
|
|
XCTAssertTrue(coordinator.window.isHidden) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|