()
| 63 | |
| 64 | /* Test the case where the condition is a non zero double */ |
| 65 | @Test |
| 66 | public void testIf02() |
| 67 | { |
| 68 | final PostfixMathCommandI c = new IfCommand(); |
| 69 | final Stack<Double> s = new Stack<>(); |
| 70 | |
| 71 | s.push(1.0); |
| 72 | s.push(1.0); |
| 73 | s.push(2.0); |
| 74 | |
| 75 | runIf(s, c); |
| 76 | |
| 77 | final Double result = s.pop(); |
| 78 | |
| 79 | assertThat("if (1.0,1.0,2.0) returns 1.0", result, closeTo(1.0, 0.1)); |
| 80 | } |
| 81 | |
| 82 | /* Test the case where the condition is a false boolean */ |
| 83 | @Test |