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

Method testIf02

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

runIfMethod · 0.95
pushMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected