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