Skip to content

Commit

Permalink
Add source.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexrus committed Jan 20, 2015
1 parent 3c5feaf commit 10e02a3
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions VPNOnTests/VPNOnTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,38 @@

import UIKit
import XCTest
import VPNOnKit
import CoreData

class VPNOnTests: XCTestCase {

var dataManager = VPNDataManager.sharedManager
var manager = VPNManager.sharedManager()

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
for vpn in dataManager.allVPN() {
dataManager.deleteVPN(vpn as VPN)
}
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testCreateVPN() {
XCTAssert(dataManager.createVPN("hello", server: "world", account: "aaa", password: "asdf", group: "asdf", secret: "asdf", alwaysOn: true), "VPN must be created.")
}

func testActivatedVPN() {
// This is an example of a functional test case.
XCTAssert(VPNDataManager.sharedManager.createVPN("hello", server: "world", account: "aaa", password: "asdf", group: "asdf", secret: "asdf", alwaysOn: true), "VPN must be created.")
XCTAssert(VPNDataManager.sharedManager.activatedVPN != nil, "Activated VPN must not be nil.")
manager.activatedVPNID = dataManager.allVPN().last!.ID
XCTAssert(dataManager.activatedVPN != nil, "Activated VPN must not be nil.")
}

func testDeleteVPN() {
let lastVPN = dataManager.allVPN().last!
XCTAssert(dataManager.deleteVPN(lastVPN), "This VPN must be deleted.")
}

func testPerformanceExample() {
Expand Down

0 comments on commit 10e02a3

Please sign in to comment.