public void ShouldExceptionMessageContainTypeName(EqualsTransitiveAssertion sut) { var exception = Record.Exception( () => sut.Verify(typeof(NotTransitiveEqualsExample).GetMethod("Equals", BindingFlags.Public | BindingFlags.Instance))); Assert.Contains(typeof(NotTransitiveEqualsExample).Name, exception.Message); }
public void ShouldThrowWhenEqualsImplementationIsNotTransitive(EqualsTransitiveAssertion sut) { var exception = Record.Exception( () => sut.Verify(typeof(NotTransitiveEqualsExample).GetMethod("Equals", BindingFlags.Public | BindingFlags.Instance))); Assert.IsType <EqualsTransitiveException>(exception); }