Пример #1
0
        public void EqualsTest_Null_Check()
        {
            // The type we are testing
            DistanceBetweenPoints target = new DistanceBetweenPoints()
            {
                Behaviour = BehaviourTypes.Increasing,
                Max = -1,
                Min = -1
            };

            bool expected = false;
            bool actual = target.Equals(null);

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void EqualsTest_Same_Type_of_RuleData_with_same_value()
        {
            // The type we are testing
            DistanceBetweenPoints target = new DistanceBetweenPoints()
            {
                Behaviour = BehaviourTypes.Increasing,
                Max = -1,
                Min = -1
            };

            // Another instance of same type of ruleData
            IPrimitiveConditionData anotherRuleData = new DistanceBetweenPoints()
            {
                Behaviour = BehaviourTypes.Increasing,
                Max = -1,
                Min = -1
            };

            // Since the values are same, it should be equal
            bool expected = true;
            bool actual = target.Equals(anotherRuleData);

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void EqualsTest_Different_Types_of_RuleData()
        {
            // The type we are testing
            DistanceBetweenPoints target = new DistanceBetweenPoints()
            {
                Behaviour = BehaviourTypes.Increasing,
                Max = -1,
                Min = -1
            };

            // Any random type - just not the type that we are testing
            IPrimitiveConditionData anotherRuleData = new ClosedLoop();

            // Since the ruleData are of different type, it should not be equal
            bool expected = false;
            bool actual = target.Equals(anotherRuleData);

            Assert.AreEqual(expected, actual, "Different types of rules should not match!");
        }