March 2018
Intermediate to advanced
324 pages
8h 30m
English
Complex operations are difficult to address, because mixing operations makes it really difficult for the non-trained human eye to understand in which order the operations should take place. Also, different evaluation orders usually lead to different results. To solve that, the computation of reverse polish expressions is backed up by the implementation of a queue. These are some tests for our next functionality:
@Testpublic void multipleAddOperationsReturnCorrectValue() { assertThat(reversePolishNotation.compute("1 2 5 + +")) .isEqualTo(8);}@Testpublic void multipleDifferentOperationsReturnCorrectValue() { assertThat(reversePolishNotation.compute("5 12 + 3 -")) .isEqualTo(14);}@Testpublic void aComplexTest() ...Read now
Unlock full access