MCPcopy Create free account
hub / github.com/PCGen/pcgen / testIf01

Method testIf01

code/src/test/plugin/jepcommands/IfCommandTest.java:47–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

runIfMethod · 0.95
pushMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected