Ejemplo n.º 1
0
        public void VerifyIllbehavedEqualsSuccessiveBehaviourThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSuccessiveAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <EqualsOverrideException>(() =>
                                                    sut.Verify(typeof(IllBehavedEqualsSuccessiveObjectOverride)));
        }
Ejemplo n.º 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))));
        }
Ejemplo n.º 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))));
        }
Ejemplo n.º 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
        }