use of org.yakindu.base.expressions.expressions.FloatLiteral in project statecharts by Yakindu.
the class Assert method assertExpressionEquals.
public static void assertExpressionEquals(String expected, Expression current) {
String currentValue = null;
if (current instanceof PrimitiveValueExpression) {
Literal literal = ((PrimitiveValueExpression) current).getValue();
if (literal instanceof BoolLiteral) {
currentValue = Boolean.toString(((BoolLiteral) literal).isValue());
} else if (literal instanceof IntLiteral) {
currentValue = Long.toString(((IntLiteral) literal).getValue());
} else if (literal instanceof DoubleLiteral) {
currentValue = Double.toString(((DoubleLiteral) literal).getValue());
} else if (literal instanceof FloatLiteral) {
currentValue = Double.toString(((FloatLiteral) literal).getValue());
} else if (literal instanceof StringLiteral) {
currentValue = (((StringLiteral) literal).getValue());
}
}
assertEquals(expected, currentValue);
}
Aggregations