use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class TestMathFunctions method testRoundToFraction.
@Test
public void testRoundToFraction() {
FunctionInterface round = fff.getInstance(cl, "Round");
round.reset();
round.insertFloatOperand(10.12345);
round.insertIntegerOperand(3);
double actual = (Double) round.evaluateWithTypeChecking();
assertEquals(10.123, actual, 0.000001);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class TestMathFunctions method testMin.
@Test
public void testMin() {
FunctionInterface min = fff.getInstance(cl, "Min");
min.reset();
min.insertIntegerOperand(20);
min.insertIntegerOperand(10);
int actual = (Integer) min.evaluateWithTypeChecking();
assertEquals(10, actual);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class TestMathFunctions method testFloor.
@Test
public void testFloor() {
FunctionInterface floor = fff.getInstance(cl, "Floor");
floor.reset();
floor.insertFloatOperand(1.1);
double actual = (Double) floor.evaluate();
assertEquals(1.0, actual, 0.000001);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class TestMathFunctions method testCeil.
@Test
public void testCeil() {
FunctionInterface ceil = fff.getInstance(cl, "Ceil");
ceil.reset();
ceil.insertFloatOperand(1.1);
double actual = (Double) ceil.evaluate();
assertEquals(2.0, actual, 0.000001);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class TestMathFunctions method testFloorWithBogusParameter.
@Test(expected = TMLExpressionException.class)
public void testFloorWithBogusParameter() {
FunctionInterface floor = fff.getInstance(cl, "Floor");
floor.reset();
floor.insertStringOperand("1.1");
floor.evaluate();
}
Aggregations