()
| 45 | |
| 46 | /* Test the case where the condition is a zero double */ |
| 47 | @Test |
| 48 | public void testIf01() throws ParseException |
| 49 | { |
| 50 | final PostfixMathCommandI c = new IfCommand(); |
| 51 | final Stack<Double> s = new Stack<>(); |
| 52 | |
| 53 | s.push(0.0); |
| 54 | s.push(1.0); |
| 55 | s.push(2.0); |
| 56 | |
| 57 | runIf(s, c); |
| 58 | |
| 59 | final Double result = s.pop(); |
| 60 | |
| 61 | assertThat("if (0.0,1.0,2.0) returns 2.0", result, closeTo(2.0, 0.1)); |
| 62 | } |
| 63 | |
| 64 | /* Test the case where the condition is a non zero double */ |
| 65 | @Test |