From 1126b7f4137c1a2e173a8d0e4626f0407717a746 Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Tue, 18 Jul 2017 17:27:32 +0300 Subject: [PATCH] Add reachability test --- .../OpenVPNReachabilityTests.swift | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 OpenVPN Adapter Tests/OpenVPNReachabilityTests.swift diff --git a/OpenVPN Adapter Tests/OpenVPNReachabilityTests.swift b/OpenVPN Adapter Tests/OpenVPNReachabilityTests.swift new file mode 100644 index 0000000..7e93e65 --- /dev/null +++ b/OpenVPN Adapter Tests/OpenVPNReachabilityTests.swift @@ -0,0 +1,37 @@ +// +// OpenVPNReachabilityTests.swift +// OpenVPN Adapter +// +// Created by Sergey Abramchuk on 18.07.17. +// +// + +import XCTest +@testable import OpenVPNAdapter + +class OpenVPNReachabilityTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testReachability() { + let reachabilityExpectation = expectation(description: "me.ss-abramchuk.openvpn-adapter.reachability") + + let reachability = OpenVPNReachability() + reachability.reachabilityStatusChangedBlock = { status in + print("Current Status: \(status.rawValue)") + } + + reachability.startTracking() + + waitForExpectations(timeout: 120.0, handler: nil) + } + +}