示例#1
0
        public void VerifyIllbehavedEqualsSuccessiveBehaviourThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <EqualsOverrideException>(() =>
                                                    sut.Verify(typeof(IllBehavedEqualsSuccessiveObjectOverride)));
        }
示例#2
0
        public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Act & Assert
            Assert.Null(Record.Exception(() =>
                                         sut.Verify(typeof(ClassThatDoesNotOverrideObjectEquals))));
        }
示例#3
0
        public void VerifyWellBehavedEqualsSuccessiveOverrideDoesNotThrow()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Act & Assert
            Assert.Null(Record.Exception(() =>
                                         sut.Verify(typeof(WellBehavedEqualsSuccessiveObjectOverride))));
        }
示例#4
0
        public void VerifyNullMethodThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Verify((MethodInfo)null));
        }
        public void VerifyIllbehavedEqualsSuccessiveBehaviourThrows()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.Throws <EqualsOverrideException>(() =>
                                                    sut.Verify(typeof(IllBehavedEqualsSuccessiveObjectOverride)));
            // Teardown
        }
        public void VerifyWellBehavedEqualsSuccessiveOverrideDoesNotThrow()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.DoesNotThrow(() =>
                                sut.Verify(typeof(WellBehavedEqualsSuccessiveObjectOverride)));
            // Teardown
        }
        public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.DoesNotThrow(() =>
                                sut.Verify(typeof(ClassThatDoesNotOverrideObjectEquals)));
            // Teardown
        }
        public void VerifyNullMethodThrows()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Verify((MethodInfo)null));
            // Teardown
        }