@Test
public void testForFloatApproximatelyEqualsWithRelativeTolerance() {
TechnicalProperty property = createPropertyWithTypeFloat();
Constraint constraint = createConstraint(property, "1");
constraint.setOperator(BaseConditionOperators.EQUALS);
assignedConstraintsSet.getAssignedConstraints().add(constraint);
BaseCondition baseCondition = createBaseCondition(property,
BaseConditionOperators.APPROXIMATELY_EQUALS, "1");
baseCondition.setTolerance("0.01");
baseCondition.setToleranceType(ToleranceTypes.RELATIVE);
precondition.setLogicalConnectiveType(LogicalConnectiveTypes.AND);
precondition.getBaseConditions().add(baseCondition);
// test for true
constraint.setValue("1.0");
assertLogicalTrue();
constraint.setValue("1.01f");
assertLogicalTrue();
constraint.setValue("0.99f");
assertLogicalTrue();
// test for false
constraint.setValue("1.011");
assertLogicalFalse();
constraint.setValue("0.989");
assertLogicalFalse();
}