December 2018
Intermediate to advanced
414 pages
10h 19m
English
In the second test we write, we'll show that we need to change the internal representation of the calculator.
The scenario we want to test is that when we tap on Enter, the number we just entered moves from the first to the second position: WHEN we select the two AND we tap on Enter THEN the stack first position is empty AND the second contains the number 2.
With this scenario, we want to introduce Enter as a way to add multiple operands. The test could be written as follows:
func test_TwoEnter__TwoOnSecondPlace() { rpnCalculator.new(element: "2") rpnCalculator.new(element: "e") XCTAssertEqual(rpnCalculator.line0, "") XCTAssertEqual(rpnCalculator.line1, "2") }
We must now introduce an implementation of Stack. The Swift standard ...
Read now
Unlock full access