示例#1
0
        public void CompareSimpleObjectsThatShouldNotMatch()
        {
            var object1 = new NonBuiltInClass {
                TheValue = "Value1"
            };
            var object2 = new NonBuiltInClass {
                TheValue = "Value2"
            };

            var result = comparer.AreEqual(object1, object2);

            Assert.IsFalse(result.AreEqual, "Object should not match.");
        }
示例#2
0
        public void IgnoreSpecificProperties()
        {
            comparer.Ignore <NonBuiltInClass, string>(x => x.TheValue);

            var object1 = new NonBuiltInClass();
            var object2 = new NonBuiltInClass();

            object1.TheValue = "Something";
            object2.TheValue = "SomethingElse";

            var result = comparer.AreEqual(object1, object2);

            Assert.IsTrue(result.AreEqual, "Objects should be equal despite ignored property being different.");
        }
示例#3
0
        public void IgnoreSpecificProperties()
        {
            comparer.Ignore<NonBuiltInClass, string>(x => x.TheValue);

            var object1 = new NonBuiltInClass();
            var object2 = new NonBuiltInClass();
            object1.TheValue = "Something";
            object2.TheValue = "SomethingElse";

            var result = comparer.AreEqual(object1, object2);

            Assert.IsTrue(result.AreEqual, "Objects should be equal despite ignored property being different.");
        }
示例#4
0
        public void CompareSimpleObjectsThatShouldNotMatch()
        {
            var object1 = new NonBuiltInClass { TheValue = "Value1" };
            var object2 = new NonBuiltInClass { TheValue = "Value2" };

            var result = comparer.AreEqual(object1, object2);

            Assert.IsFalse(result.AreEqual, "Object should not match.");
        }