public void EqualObjectsShouldPass() { var testObject1 = new TestClass { IntProperty = 1, StringProperty = "abc" }; var testObject2 = new TestClass { IntProperty = 1, StringProperty = "abc" }; var assertProperties = new PropertyEqualityAssertion <ITestClass>(testObject1, testObject2, "a message"); assertProperties.AreEqual(o => o.IntProperty); assertProperties.AreEqual(o => o.StringProperty); }
public void UnEqualObjectsShouldNotPass2() { var testObject1 = new TestClass { IntProperty = 1, StringProperty = "abc" }; var testObject2 = new TestClass { IntProperty = 1, StringProperty = "abcd" }; var assertProperties = new PropertyEqualityAssertion <ITestClass>(testObject1, testObject2, "strings are not equal"); assertProperties.AreEqual(o => o.StringProperty); }