precondition.setLogicalConnectiveType(LogicalConnectiveTypes.XOR);
precondition.getBaseConditions().add(baseCondition1);
precondition.getBaseConditions().add(baseCondition2);
Constraint constraint1 = createConstraint(property1, "true");
constraint1.setOperator(BaseConditionOperators.EQUALS);
Constraint constraint2 = createConstraint(property2, "true");
constraint2.setOperator(BaseConditionOperators.EQUALS);
assignedConstraintsSet.getAssignedConstraints().add(constraint1);
assignedConstraintsSet.getAssignedConstraints().add(constraint2);
// true / true
constraint1.setValue("true");
constraint2.setValue("true");
assertLogicalFalse();
assertAssignmentForPropertyIsNotRequiered(property1);
assertAssignmentForPropertyIsNotRequiered(property2);
// true / false
constraint1.setValue("true");
constraint2.setValue("false");
assertLogicalTrue();
assertAssignmentForPropertyIsNotRequiered(property1);
assertAssignmentForPropertyIsNotRequiered(property2);
// false /true
constraint1.setValue("false");
constraint2.setValue("true");
assertLogicalTrue();
assertAssignmentForPropertyIsNotRequiered(property1);
assertAssignmentForPropertyIsNotRequiered(property2);
// false /false
constraint1.setValue("false");
constraint2.setValue("false");
assertLogicalFalse();
assertAssignmentForPropertyIsNotRequiered(property1);
assertAssignmentForPropertyIsNotRequiered(property2);
// undefined /false
constraint1.setTechnicalProperty(property3);
constraint2.setTechnicalProperty(property2);
constraint1.setValue("true");
constraint2.setValue("false");
assertLogicalUndefined();
assertPropertyIsUnassigned(property1, true);
assertAssignmentForPropertyIsNotRequiered(property2);
// undefined /true
constraint1.setTechnicalProperty(property3);
constraint2.setTechnicalProperty(property2);
constraint1.setValue("true");
constraint2.setValue("true");
assertLogicalUndefined();
assertPropertyIsUnassigned(property1, true);
assertAssignmentForPropertyIsNotRequiered(property2);
// false / undefined
constraint1.setTechnicalProperty(property1);
constraint2.setTechnicalProperty(property3);
constraint1.setValue("false");
constraint2.setValue("true");
assertLogicalUndefined();
assertAssignmentForPropertyIsNotRequiered(property1);
assertPropertyIsUnassigned(property2, true);
// true / undefined
constraint1.setTechnicalProperty(property1);
constraint2.setTechnicalProperty(property3);
constraint1.setValue("true");
constraint2.setValue("true");
assertLogicalUndefined();
assertAssignmentForPropertyIsNotRequiered(property1);
assertPropertyIsUnassigned(property2, true);
// undefined / undefined
constraint1.setTechnicalProperty(property3);
constraint2.setTechnicalProperty(property4);
constraint1.setValue("true");
constraint2.setValue("true");
assertLogicalUndefined();
assertPropertyIsUnassigned(property1, false);
assertPropertyIsUnassigned(property2, false);