()
| 99 | |
| 100 | /* Test the case where the condition is a true boolean */ |
| 101 | @Test |
| 102 | public void testIf04() |
| 103 | { |
| 104 | final PostfixMathCommandI c = new IfCommand(); |
| 105 | final Stack<Boolean> s = new Stack<>(); |
| 106 | |
| 107 | s.push(true); |
| 108 | s.push(false); |
| 109 | s.push(true); |
| 110 | |
| 111 | runIf(s, c); |
| 112 | |
| 113 | final Boolean result = s.pop(); |
| 114 | |
| 115 | assertThat("if (true,false,true) returns true", result, is(false)); |
| 116 | } |
| 117 | } |