Exemple #1
0
        public void VerifyIllbehavedEqualsSelfBehaviourThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualsSelfAssertion(dummyComposer);

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

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

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

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Verify((MethodInfo)null));
        }
Exemple #5
0
        public void VerifyIllbehavedEqualsSelfBehaviourThrows()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSelfAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.Throws <EqualsOverrideException>(() =>
                                                    sut.Verify(typeof(IllBehavedEqualsSelfObjectOverride)));
            // Teardown
        }
Exemple #6
0
        public void VerifyWellBehavedEqualsSelfOverrideDoesNotThrow()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSelfAssertion(dummyComposer);

            // Exercise system and verify outcome
            Assert.DoesNotThrow(() =>
                                sut.Verify(typeof(WellBehavedEqualsSelfObjectOverride)));
            // Teardown
        }
Exemple #7
0
        public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing()
        {
            // Fixture setup
            var dummyComposer = new Fixture();
            var sut           = new EqualsSelfAssertion(dummyComposer);

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

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