summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Bulhak <andrew.bulhak@mullvad.net>2024-02-07 10:26:54 +0100
committerBug Magnet <marco.nikic@mullvad.net>2024-02-07 15:13:22 +0100
commit2b42d8febf721809439a6ce6affc69ae60d1203b (patch)
tree163bb6522b1b534e6fc41438328e491718ebb7c7
parentd35a07b6cd20062d531263f5b36ccbd130a13e27 (diff)
downloadmullvadvpn-2b42d8febf721809439a6ce6affc69ae60d1203b.tar.xz
mullvadvpn-2b42d8febf721809439a6ce6affc69ae60d1203b.zip
Miscellaneous PR feedback
-rw-r--r--ios/MullvadVPNTests/StartTunnelOperationTests.swift15
1 files changed, 6 insertions, 9 deletions
diff --git a/ios/MullvadVPNTests/StartTunnelOperationTests.swift b/ios/MullvadVPNTests/StartTunnelOperationTests.swift
index 840a88c6c5..5dfd5d904f 100644
--- a/ios/MullvadVPNTests/StartTunnelOperationTests.swift
+++ b/ios/MullvadVPNTests/StartTunnelOperationTests.swift
@@ -36,7 +36,7 @@ class StartTunnelOperationTests: XCTestCase {
)
func makeInteractor(deviceState: DeviceState, tunnelState: TunnelState? = nil) -> MockTunnelInteractor {
- var interactor = MockTunnelInteractor(
+ let interactor = MockTunnelInteractor(
isConfigurationLoaded: true,
settings: LatestTunnelSettings(),
deviceState: deviceState
@@ -50,8 +50,7 @@ class StartTunnelOperationTests: XCTestCase {
// MARK: the tests
func testFailsIfNotLoggedIn() throws {
- let settings = LatestTunnelSettings()
- let exp = expectation(description: "Start tunnel operation failed")
+ let expectation = expectation(description: "Start tunnel operation failed")
let operation = StartTunnelOperation(
dispatchQueue: testQueue,
interactor: makeInteractor(deviceState: .loggedOut)
@@ -60,16 +59,15 @@ class StartTunnelOperationTests: XCTestCase {
XCTFail("Operation returned \(result), not failure")
return
}
- exp.fulfill()
+ expectation.fulfill()
}
operationQueue.addOperation(operation)
- wait(for: [exp], timeout: 1.0)
+ wait(for: [expectation], timeout: 1.0)
}
func testSetsReconnectIfDisconnecting() {
- let settings = LatestTunnelSettings()
- var interactor = makeInteractor(deviceState: loggedInDeviceState, tunnelState: .disconnecting(.nothing))
+ let interactor = makeInteractor(deviceState: loggedInDeviceState, tunnelState: .disconnecting(.nothing))
var tunnelStatus = TunnelStatus()
interactor.onUpdateTunnelStatus = { status in tunnelStatus = status }
let expectation = expectation(description: "Tunnel status set to reconnect")
@@ -86,8 +84,7 @@ class StartTunnelOperationTests: XCTestCase {
}
func testStartsTunnelIfDisconnected() {
- let settings = LatestTunnelSettings()
- var interactor = makeInteractor(deviceState: loggedInDeviceState, tunnelState: .disconnected)
+ let interactor = makeInteractor(deviceState: loggedInDeviceState, tunnelState: .disconnected)
let expectation = expectation(description: "Make tunnel provider and start tunnel")
let operation = StartTunnelOperation(
dispatchQueue: testQueue,