mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Update tests
This commit is contained in:
@@ -32,7 +32,7 @@ class OpenVPNAdapterTests: XCTestCase {
|
|||||||
func testApplyConfiguration() {
|
func testApplyConfiguration() {
|
||||||
guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() }
|
guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() }
|
||||||
|
|
||||||
let adapter = OpenVPNAdapter()
|
let adapter = OpenVPNAdapter(packetFlow: customFlow)
|
||||||
|
|
||||||
let configuration = OpenVPNConfiguration()
|
let configuration = OpenVPNConfiguration()
|
||||||
configuration.fileContent = vpnConfiguration
|
configuration.fileContent = vpnConfiguration
|
||||||
@@ -52,7 +52,7 @@ class OpenVPNAdapterTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testProvideCredentials() {
|
func testProvideCredentials() {
|
||||||
let adapter = OpenVPNAdapter()
|
let adapter = OpenVPNAdapter(packetFlow: customFlow)
|
||||||
|
|
||||||
let credentials = OpenVPNCredentials()
|
let credentials = OpenVPNCredentials()
|
||||||
credentials.username = "username"
|
credentials.username = "username"
|
||||||
@@ -71,7 +71,7 @@ class OpenVPNAdapterTests: XCTestCase {
|
|||||||
func testConnection() {
|
func testConnection() {
|
||||||
guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() }
|
guard let vpnConfiguration = VPNProfile.configuration.data(using: .utf8) else { fatalError() }
|
||||||
|
|
||||||
let adapter = OpenVPNAdapter()
|
let adapter = OpenVPNAdapter(packetFlow: customFlow)
|
||||||
|
|
||||||
let configuration = OpenVPNConfiguration()
|
let configuration = OpenVPNConfiguration()
|
||||||
configuration.fileContent = vpnConfiguration
|
configuration.fileContent = vpnConfiguration
|
||||||
@@ -110,9 +110,8 @@ class OpenVPNAdapterTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension OpenVPNAdapterTests: OpenVPNAdapterDelegate {
|
extension OpenVPNAdapterTests: OpenVPNAdapterDelegate {
|
||||||
|
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings?, completionHandler: @escaping (Error?) -> Void) {
|
||||||
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, configureTunnelWithNetworkSettings networkSettings: NEPacketTunnelNetworkSettings?, completionHandler: @escaping (OpenVPNAdapterPacketFlow?) -> Void) {
|
completionHandler(nil)
|
||||||
completionHandler(customFlow)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleEvent event: OpenVPNAdapterEvent, message: String?) {
|
func openVPNAdapter(_ openVPNAdapter: OpenVPNAdapter, handleEvent event: OpenVPNAdapterEvent, message: String?) {
|
||||||
|
|||||||
Reference in New Issue
Block a user