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."); }
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."); }
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."); }