()
| 45 | |
| 46 | /* Test the case where the first operand is true */ |
| 47 | @Test |
| 48 | public void testOr01() |
| 49 | { |
| 50 | final PostfixMathCommandI c = new OrCommand(); |
| 51 | final Stack<Object> s = new Stack<>(); |
| 52 | |
| 53 | s.push(1.0); |
| 54 | s.push(2.0); |
| 55 | |
| 56 | c.setCurNumberOfParameters(2); |
| 57 | |
| 58 | runOr(s, c); |
| 59 | |
| 60 | final Double result = (Double) s.pop(); |
| 61 | |
| 62 | assertThat("if (1.0,2.0) returns 1.0", result, closeTo(1.0, 0.1)); |
| 63 | } |
| 64 | |
| 65 | /* Test the case where the first operand is false, but the second is true */ |
| 66 | @Test |