Пример #1
0
        public void SutDoesNotEqualAnonymousObject(object other)
        {
            var e1  = new Mock <IReflectionElement>().Object;
            var e2  = new Mock <IReflectionElement>().Object;
            var e3  = new Mock <IReflectionElement>().Object;
            var sut = new CompositeReflectionElement(e1, e2, e3);

            var actual = sut.Equals(other);

            Assert.False(actual);
        }
Пример #2
0
        public void SutEqualsOtherIdenticalInstance()
        {
            var e1    = new Mock <IReflectionElement>().Object;
            var e2    = new Mock <IReflectionElement>().Object;
            var e3    = new Mock <IReflectionElement>().Object;
            var sut   = new CompositeReflectionElement(e1, e2, e3);
            var other = new CompositeReflectionElement(e1, e2, e3);

            var actual = sut.Equals(other);

            Assert.True(actual);
        }
        public void SutEqualsOtherIdenticalInstance()
        {
            var e1 = new Mock<IReflectionElement>().Object;
            var e2 = new Mock<IReflectionElement>().Object;
            var e3 = new Mock<IReflectionElement>().Object;
            var sut = new CompositeReflectionElement(e1, e2, e3);
            var other = new CompositeReflectionElement(e1, e2, e3);

            var actual = sut.Equals(other);

            Assert.True(actual);
        }
Пример #4
0
        public void SutDoesNotEqualDifferentInstanceOfSameType()
        {
            // Fixture setup
            var e1  = new Mock <IReflectionElement>().Object;
            var e2  = new Mock <IReflectionElement>().Object;
            var e3  = new Mock <IReflectionElement>().Object;
            var sut = new CompositeReflectionElement(e1, e2, e3);

            var e4    = new Mock <IReflectionElement>().Object;
            var e5    = new Mock <IReflectionElement>().Object;
            var e6    = new Mock <IReflectionElement>().Object;
            var other = new CompositeReflectionElement(e4, e5, e6);

            // Exercise system
            var actual = sut.Equals(other);

            // Verify outcome
            Assert.False(actual);

            // Teardown
        }
        public void SutDoesNotEqualAnonymousObject(object other)
        {
            var e1 = new Mock<IReflectionElement>().Object;
            var e2 = new Mock<IReflectionElement>().Object;
            var e3 = new Mock<IReflectionElement>().Object;
            var sut = new CompositeReflectionElement(e1, e2, e3);

            var actual = sut.Equals(other);
            
            Assert.False(actual);
        }
        public void SutDoesNotEqualDifferentInstanceOfSameType()
        {
            // Fixture setup
            var e1 = new Mock<IReflectionElement>().Object;
            var e2 = new Mock<IReflectionElement>().Object;
            var e3 = new Mock<IReflectionElement>().Object;
            var sut = new CompositeReflectionElement(e1, e2, e3);

            var e4 = new Mock<IReflectionElement>().Object;
            var e5 = new Mock<IReflectionElement>().Object;
            var e6 = new Mock<IReflectionElement>().Object;
            var other = new CompositeReflectionElement(e4, e5, e6);

            // Exercise system
            var actual = sut.Equals(other);

            // Verify outcome
            Assert.False(actual);

            // Teardown
        }