public void ShouldExplainWhyExceptionIsThrownWhenHashCodeIsProducedOnIdentity(GetHashCodeValueCheckAssertion sut) { var exception = Record.Exception( () => sut.Verify(typeof (IdentityObjectHashCodeExample))); Assert.Contains( string.Format( "Expected type {0} GetHashCode method to compute bash based on value semantic not identity", typeof(IdentityObjectHashCodeExample).Name), exception.Message); }
public void ShouldThrowWhenGetHashCodeProducesHashBasedOnIdentity(GetHashCodeValueCheckAssertion sut) { EqualityTestAssert .ExceptionWasThrownForTestType<GetHashCodeValueCheckException, IdentityObjectHashCodeExample>(sut); }
public void ShouldNotThrowWhenGetHashCodeProducesHashBasedOnValues(GetHashCodeValueCheckAssertion sut) { EqualityTestAssert.ExceptionWasNotThrownForTestType<ValueObjectHashCodeExample>(sut); }