public void ShouldExplainWhyExceptionIsThrownWhenIdentityCheck(EqualityOperatorValueCheckAssertion sut) { var exception = Record.Exception( () => sut.Verify(typeof(ClassWithEqualityOperatorIdentityCheck))); Assert.Contains( string.Format( "Expected type {0} == operator to perform value check but looks like it performs identity check", typeof (ClassWithEqualityOperatorIdentityCheck).Name), exception.Message); }
public void ShouldThrowExceptionWhenIdentityCheckInEqualityOperator(EqualityOperatorValueCheckAssertion sut) { EqualityTestAssert .ExceptionWasThrownForTestType <EqualityOperatorValueCheckException, ClassWithEqualityOperatorIdentityCheck>(sut); }
public void ShouldNotThrowExceptionWhenEqualityOperatorPerformsValueCheck( EqualityOperatorValueCheckAssertion sut) { EqualityTestAssert.ExceptionWasNotThrownForTestType<ClassWithEqualityOperatorValueCheck>(sut); }
public void ShouldBeIdiomaticAssertion(EqualityOperatorValueCheckAssertion sut) { Assert.IsAssignableFrom<IdiomaticAssertion>(sut); }