public void WrongTypeInSourceCanBeDiffed() { var classA = new ClassA(null, "Test"); var classB = new ClassAWithWrongPropType(10, "Test"); var diff = classB.DiffObjects(classA); Assert.Single(diff); }
public void WhenPropertyInTargetObjectHasWrongTypeThenExceptionIsRaised() { var classA = new ClassA(1, "Test"); var classAWithWrongPropType = new ClassAWithWrongPropType(1, "Test"); Assert.Throws <InvalidCastException>(() => { classA.If().PropertyValuesMatch(classAWithWrongPropType, throwExceptionOnPropertyMismatch: true).ThenReturn(true); }); }
public void WhenPropertyInTargetObjectHasWrongTypeThenExceptionIsRaised() { var classA = new ClassA(1, "Test"); var classAWithWrongPropType = new ClassAWithWrongPropType(1, "Test"); Assert.Throws<InvalidCastException>(() => { classA.If().PropertyValuesMatch(classAWithWrongPropType).ThenReturn(true); }); }