コード例 #1
0
 @Test
 public void areNotAllFunctionsDeclared() throws Exception {
   String expression = "1 + Sin(90) + MyFunc(1)";
   ExpressionSolver target = new ExpressionSolver(expression);
   boolean actual = target.areAllFunctionsDeclared();
   boolean expected = false;
   assertThat(actual, is(equalTo(expected)));
 }
コード例 #2
0
 @Test
 public void areAllFunctionsDeclared() throws Exception {
   String expression = "1 + Sin(90) + MyFunc(1)";
   ExpressionSolver target = new ExpressionSolver(expression);
   target.addFunction("MyFunc", Arrays.asList("x"), "1 + x");
   boolean actual = target.areAllFunctionsDeclared();
   boolean expected = true;
   assertThat(actual, is(equalTo(expected)));
 }