// reset units drunk subject.unitsDrunk = 0 XCTAssertEqual(subject.unitsDrunk, 0) // set new value subject.unitsDrunk = 5 XCTAssertEqual(subject.unitsDrunk, 5) // Take other instance of tea and check if same amount applies let secondSubject = Beverage.Tea XCTAssertEqual(subject.unitsDrunk, 5) }
beverage.unitsDrunk = 0 let subject = BeverageCell(style: .Default, reuseIdentifier: nil) subject.configure(beverage) // Set stepper value subject.stepper.value = 5 subject.stepperStepped(subject.stepper) // Expect that the amount drunk label has the right value XCTAssertEqual(subject.amountDrunkLabel.text!, "5 drunk today") }