예제 #1
0
        public void ShouldExplainWhyExceptionIsThrownWhenCtorArgDoesNotInfluenceEquality(EqualsValueCheckAssertion sut)
        {
            var exception = Record.Exception(
                () => sut.Verify(typeof(ValueObjectButSecondCtrArgDoesntTakePartInEqualsImpl)));

            Assert.Equal(
                string.Format("Expected {0} to be not equal to {0}",
                              new ValueObjectButSecondCtrArgDoesntTakePartInEqualsImpl(1, 1)), exception.Message);
        }
예제 #2
0
        public void ShouldExplainWhyExceptionIsThrownWhenEqualsIsIdentityCheck(EqualsValueCheckAssertion sut)
        {
            var exception = Record.Exception(
                () => sut.Verify(typeof(object)));

            Assert.Equal(
                string.Format("Expected type {0} to perform value check but looks like it performs identity check", typeof(object).Name),
                exception.Message);
        }