use of net.taken.redsnake.lang.RedsBoolean in project redsnake by Taken0711.
the class IfTest method createIfWithAssignments.
private static If createIfWithAssignments(String variableName, boolean condition, int trueValue, int falseValue) {
Variable var = mockVariable(variableName);
Expression cond = mockExpression(new RedsBoolean(condition));
StatementList thenBody = new StatementList(ImmutableList.of(new Assignment(mockVariable(variableName), mockExpression(trueValue))));
StatementList elseBody = new StatementList(ImmutableList.of(new Assignment(mockVariable(variableName), mockExpression(falseValue))));
return new If(cond, thenBody, elseBody);
}
Aggregations