Пример #1
0
        public void Equals_should_return_false_if_any_field_is_not_equal()
        {
            var subject1 = new ClusterId(1);
            var subject2 = new ClusterId(2);

            subject1.Equals(subject2).Should().BeFalse();
            subject1.Equals((object)subject2).Should().BeFalse();
            subject1.GetHashCode().Should().NotBe(subject2.GetHashCode());
        }
Пример #2
0
        public void Equals_should_return_true_if_all_fiels_are_equal()
        {
            var subject1 = new ClusterId(1);
            var subject2 = new ClusterId(1);

            subject1.Equals(subject2).Should().BeTrue();
            subject1.Equals((object)subject2).Should().BeTrue();
            subject1.GetHashCode().Should().Be(subject2.GetHashCode());
        }
Пример #3
0
        // methods
        /// <inheritdoc/>
        public bool Equals(ClusterDescription other)
        {
            if (other == null)
            {
                return(false);
            }

            return
                (_clusterId.Equals(other._clusterId) &&
                 _servers.SequenceEqual(other._servers) &&
                 _type == other._type);
        }
        // methods
        /// <inheritdoc/>
        public bool Equals(ClusterDescription other)
        {
            if (other == null)
            {
                return(false);
            }

            return
                (_clusterId.Equals(other._clusterId) &&
                 _connectionMode == other._connectionMode &&
                 object.Equals(_dnsMonitorException, other._dnsMonitorException) &&
                 _servers.SequenceEqual(other._servers) &&
                 _type == other._type);
        }