예제 #1
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);
        }
 public void ShouldBeIdiomaticAssertion(EqualsValueCheckAssertion sut)
 {
     Assert.IsAssignableFrom <IdiomaticAssertion>(sut);
 }
예제 #3
0
 public void ShouldThrowWhenIdentityCheckInEqualsImplementation(EqualsValueCheckAssertion sut)
 {
     EqualityTestAssert.ExceptionWasThrownForTestType <EqualsValueCheckException, object>(sut);
 }
예제 #4
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);
        }
예제 #5
0
 public void ShouldThrowWhenNotEveryCtorArgumentInfluenceEquality(EqualsValueCheckAssertion sut)
 {
     EqualityTestAssert
     .ExceptionWasThrownForTestType
     <EqualsValueCheckException, ValueObjectButSecondCtrArgDoesntTakePartInEqualsImpl>(sut);
 }
예제 #6
0
 public void ShouldNotThrowWhenValueCheckInEqualsImplementation(EqualsValueCheckAssertion sut)
 {
     EqualityTestAssert.ExceptionWasNotThrownForTestType <ValueObjectExample>(sut);
 }