public void CustomFactoryMatch() { TypeWithAttributedProperty leftObject = new TypeWithAttributedProperty() { PropertyWithoutTestAttribute = "Should not be compared", PropertyWithTestAttribute = "Should be compared", }; TypeWithAttributedProperty rightObject = new TypeWithAttributedProperty() { PropertyWithoutTestAttribute = "Should not be compared - so this is different", PropertyWithTestAttribute = "Should be compared", }; ExtractAttributeObjectGraphFactory factory = new ExtractAttributeObjectGraphFactory(); ObjectComparer comparer = new ObjectComparer(factory); Assert.True(comparer.Compare(leftObject, rightObject), "Custom compare failed"); }
//[Fact] TODO: Update test. public void CustomFactoryMismatch() { TypeWithAttributedProperty leftObject = new TypeWithAttributedProperty() { PropertyWithoutTestAttribute = "Should not be compared", PropertyWithTestAttribute = "Should be compared", }; TypeWithAttributedProperty rightObject = new TypeWithAttributedProperty() { PropertyWithoutTestAttribute = "Should not be compared - so this is different", PropertyWithTestAttribute = "Should be compared - and should fail because its different", }; ExtractAttributeObjectGraphFactory factory = new ExtractAttributeObjectGraphFactory(); ObjectComparer comparer = new ObjectComparer(factory); Assert.False(comparer.Compare(leftObject, rightObject).None(), "Custom compare passed when it should have failed"); }