Equals() 공개 메소드

public Equals ( object obj ) : bool
obj object
리턴 bool
        public void SutDoesNotEqualAnonymousObject()
        {
            var sut = new CompositeMortgageApplicationProcessor();
            var anonymous = new object();

            var actual = sut.Equals(anonymous);

            Assert.False(actual);
        }
        public void SutDoesNotEqualOtherWithDifferentNodes()
        {
            // Arrange
            var moqRepo = new MockRepository(MockBehavior.Default);

            var sut = new CompositeMortgageApplicationProcessor
            {
                Nodes = new[]
                {
                    moqRepo.Create<IMortgageApplicationProcessor>().Object,
                    moqRepo.Create<IMortgageApplicationProcessor>().Object,
                    moqRepo.Create<IMortgageApplicationProcessor>().Object
                }
            };

            var other = new CompositeMortgageApplicationProcessor
            {
                Nodes = new[]
                {
                    moqRepo.Create<IMortgageApplicationProcessor>().Object,
                    moqRepo.Create<IMortgageApplicationProcessor>().Object,
                    moqRepo.Create<IMortgageApplicationProcessor>().Object
                }
            };

            // Act
            var actual = sut.Equals(other);

            // Assert
            Assert.False(actual);
        }
        public void SutEqualsOtherWithSameNodes()
        {
            // Arrange
            var moqRepo = new MockRepository(MockBehavior.Default);
            var nodes = new List<IMortgageApplicationProcessor>
            {
                moqRepo.Create<IMortgageApplicationProcessor>().Object,
                moqRepo.Create<IMortgageApplicationProcessor>().Object,
                moqRepo.Create<IMortgageApplicationProcessor>().Object
            };

            var sut = new CompositeMortgageApplicationProcessor
            {
                Nodes = nodes.ToArray()
            };

            var other = new CompositeMortgageApplicationProcessor
            {
                Nodes = nodes.ToArray()
            };

            // Act
            var actual = sut.Equals(other);

            // Arrange
            Assert.True(actual);
        }