Skip to content

Commit

Permalink
Added tests for BeaconParams initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalonunez committed Nov 8, 2017
1 parent ec03fdc commit 9acf88e
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions ParrotTests/ParrotTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,31 @@
import XCTest
@testable import Parrot

import CoreLocation

class ParrotTests: 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 testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}

func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}


let uuid = UUID(uuidString: "E621E1F8-C36C-495A-93FC-0C247A3E6E5F")!
let identifier = "com.ParrotTests.Beacon"

func testNoParams() {
let beacon = CLBeaconRegion(uuid: uuid, identifier: identifier, params: .none)
assert(beacon.identifier == identifier)
assert(beacon.major == nil)
assert(beacon.minor == nil)
}

func testOnlyMajorParams() {
let beacon = CLBeaconRegion(uuid: uuid, identifier: identifier, params: .major(100))
assert(beacon.identifier == identifier)
assert(beacon.major == 100)
assert(beacon.minor == nil)
}

func testBothMajorAndMinorParams() {
let beacon = CLBeaconRegion(uuid: uuid, identifier: identifier, params: .both(major: 100, minor: 50))
assert(beacon.identifier == identifier)
assert(beacon.major == 100)
assert(beacon.minor == 50)
}
}

0 comments on commit 9acf88e

Please sign in to comment.