public void TouchLimit_Union_With_Min_Set() { // The type we are testing TouchLimit target = new TouchLimit() { Min = 3 }; // The 2nd rule IPrimitiveConditionData anotherRuleData = new TouchLimit() { Min = 1 }; //Union of the 2 rules, should result in rule with min of 1 target.Union(anotherRuleData); //We expect the union to have a min of 1 bool expected = true; bool actual = target.Min.Equals(1); //Assert they are equal Assert.AreEqual(expected, actual); }
public void TouchLimit_Union_With_Type_Change() { // The type we are testing TouchLimit target = new TouchLimit() { Max = 1, Type = "FixedValue" }; // The 2nd rule IPrimitiveConditionData anotherRuleData = new TouchLimit() { Max = 7 }; //Union of the 2 rules, should result in rule with max of 7 target.Union(anotherRuleData); //We expect the union to have a max of 7, but the type should now be range, as it was not before bool expected = true; bool actual = target.Type.Equals("Range"); //Assert they are equal Assert.AreEqual(expected, actual); }
public void TouchLimit_Union_With_A_Null_Test() { // The type we are testing TouchLimit target = new TouchLimit(); // Since the ruleData is null, the union should fail IPrimitiveConditionData anotherRuleData = null; //Union should fail target.Union(anotherRuleData); }