示例#1
0
        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);
        }
示例#2
0
        public void ShouldThrowWhenEqualsImplementationIsNotTransitive(EqualsTransitiveAssertion sut)
        {
            var exception =
                Record.Exception(
                    () =>
                    sut.Verify(typeof(NotTransitiveEqualsExample).GetMethod("Equals",
                                                                            BindingFlags.Public | BindingFlags.Instance)));

            Assert.IsType <EqualsTransitiveException>(exception);
        }