Skip to content

Commit

Permalink
Merge pull request #64 from czechboy0/hd/tests_1
Browse files Browse the repository at this point in the history
reinstated previously disabled tests due to the Xcode 7 refactoring
  • Loading branch information
Honza Dvorsky committed Jul 3, 2015
2 parents 07933c2 + bff8f49 commit 52dc8a1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "czechboy0/DVR" "2742bb80be229da51b1c923c3d3e6eaadc129b8e"
github "czechboy0/DVR" "b6f1e80acacfa5913a0bbc6b14583fcce8faa08a"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "czechboy0/DVR" "2742bb80be229da51b1c923c3d3e6eaadc129b8e"
github "czechboy0/DVR" "b6f1e80acacfa5913a0bbc6b14583fcce8faa08a"
79 changes: 28 additions & 51 deletions XcodeServerSDKTests/BotConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ import XcodeServerSDK

class BotConfigurationTests: 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()
}

// MARK: Cleaning policy tests
func testCleaningPolicyToString() {
var policy: BotConfiguration.CleaningPolicy

Expand All @@ -38,51 +27,39 @@ class BotConfigurationTests: XCTestCase {
XCTAssertEqual(policy.toString(), "Once a week (first build)")
}

// MARK: Testing destination tests
func testTestingDestinationToString() {
// var destination: BotConfiguration.TestingDestinationIdentifier
func testDeviceFilterToString() {
var filter: DeviceFilter.FilterType

//TODO: being moved to DeviceSpecification
// destination = .iOS_AllDevicesAndSimulators
// XCTAssertEqual(destination.toString(), "iOS: All Devices and Simulators")
//
// destination = .iOS_AllDevices
// XCTAssertEqual(destination.toString(), "iOS: All Devices")
//
// destination = .iOS_AllSimulators
// XCTAssertEqual(destination.toString(), "iOS: All Simulators")
//
// destination = .iOS_SelectedDevicesAndSimulators
// XCTAssertEqual(destination.toString(), "iOS: Selected Devices and Simulators")
//
// destination = .Mac
// XCTAssertEqual(destination.toString(), "Mac")
//
// destination = .AllCompatible
// XCTAssertEqual(destination.toString(), "All Compatible (Mac + iOS)")
filter = .AllAvailableDevicesAndSimulators
XCTAssertEqual(filter.toString(), "All Available Devices and Simulators")

filter = .AllDevices
XCTAssertEqual(filter.toString(), "All Devices")

filter = .AllSimulators
XCTAssertEqual(filter.toString(), "All Simulators")

filter = .SelectedDevicesAndSimulators
XCTAssertEqual(filter.toString(), "Selected Devices and Simulators")
}

func testAllowedDevicesTypes() {
// let allCompatible = BotConfiguration.TestingDestinationIdentifier.AllCompatible
// let selected = BotConfiguration.TestingDestinationIdentifier.iOS_SelectedDevicesAndSimulators
// let allDevicesAndSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevicesAndSimulators
// let allDevices = BotConfiguration.TestingDestinationIdentifier.iOS_AllDevices
// let allSimulators = BotConfiguration.TestingDestinationIdentifier.iOS_AllSimulators
// let mac = BotConfiguration.TestingDestinationIdentifier.Mac
func testAvailableFiltersForPlatform() {

// let allCompatibleExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator, .Mac]
// let selectedExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator]
// let allDevicesAndSimulatorsExpected: [BotConfiguration.DeviceType] = [.iPhone, .Simulator]
// let allDevicesExpected: [BotConfiguration.DeviceType] = [.iPhone]
// let allSimulatorsExpected: [BotConfiguration.DeviceType] = [.Simulator]
// let macExpected: [BotConfiguration.DeviceType] = [.Mac]
XCTAssertEqual(DeviceFilter.FilterType.availableFiltersForPlatform(.iOS), [
.AllAvailableDevicesAndSimulators,
.AllDevices,
.AllSimulators,
.SelectedDevicesAndSimulators
])

// XCTAssertEqual(allCompatible.allowedDeviceTypes(), allCompatibleExpected)
// XCTAssertEqual(selected.allowedDeviceTypes(), selectedExpected)
// XCTAssertEqual(allDevices.allowedDeviceTypes(), allDevicesExpected)
// XCTAssertEqual(allSimulators.allowedDeviceTypes(), allSimulatorsExpected)
// XCTAssertEqual(allDevicesAndSimulators.allowedDeviceTypes(), allDevicesAndSimulatorsExpected)
// XCTAssertEqual(mac.allowedDeviceTypes(), macExpected)
XCTAssertEqual(DeviceFilter.FilterType.availableFiltersForPlatform(.OSX), [
.AllAvailableDevicesAndSimulators
])

XCTAssertEqual(DeviceFilter.FilterType.availableFiltersForPlatform(.watchOS), [
.AllAvailableDevicesAndSimulators
])
}

}

0 comments on commit 52dc8a1

Please sign in to comment.