@@ -10,27 +10,33 @@ import UIKit
10import XCTest
10import XCTest
12class GMStepperExampleTests: XCTestCase {
12class GMStepperExampleTests: XCTestCase {
13−
13+ var stepper: GMStepper!
14 override func setUp() {
15 override func setUp() {
15 super.setUp()
16 super.setUp()
16− // Put setup code here. This method is called before the invocation of each test method in the class.
17+ stepper = GMStepper()
19− override func tearDown() {
20+ func testDefaults() {
20− // Put teardown code here. This method is called after the invocation of each test method in the class.
21+ XCTAssert(stepper.minimumValue == 0, "minimumValue defaults 0")
21− super.tearDown()
22+ XCTAssert(stepper.maximumValue == 10, "maximumValue defaults to 10")
23+ XCTAssert(stepper.value == 0, "value defaults to 0")
24− func testExample() {
26+ func testMinimum_limitsValue() {
25− // This is an example of a functional test case.
27+ stepper.minimumValue = 1
26− XCTAssert(true, "Pass")
30+ XCTAssert(stepper.value == stepper.minimumValue, "Pass")
29− func testPerformanceExample() {
33+ func testMaximum_limitsValue() {
30− // This is an example of a performance test case.
34+ let stepper = GMStepper()
31− self.measureBlock() {
35+ stepper.maximumValue = 1
32− // Put the code you want to measure the time of here.
36+ stepper.value = 2
38+ XCTAssert(stepper.value == stepper.maximumValue, "Pass")