Exemple #1
0
        public void Equals_should_return_true_if_all_fields_are_equal()
        {
            var wMode1 = new WriteConcern.WMode("mode");
            var wMode2 = new WriteConcern.WMode("mode");

            wMode1.Equals(wMode2).Should().BeTrue();
            wMode1.Equals((object)wMode2).Should().BeTrue();
            wMode1.GetHashCode().Should().Be(wMode2.GetHashCode());
        }
Exemple #2
0
        public void Equals_should_return_false_if_values_are_not_equal(string value1, string value2)
        {
            var wMode1 = new WriteConcern.WMode(value1);
            var wMode2 = new WriteConcern.WMode(value2);

            wMode1.Equals(wMode2).Should().BeFalse();
            wMode1.Equals((object)wMode2).Should().BeFalse();
            wMode1.GetHashCode().Should().NotBe(wMode2.GetHashCode());
        }
Exemple #3
0
        public void Equals_should_return_true_when_all_fields_are_equal()
        {
            var subject1 = new WriteConcern.WMode("mode");
            var subject2 = new WriteConcern.WMode("mode");

            var result1   = subject1.Equals(subject2);
            var result2   = subject1.Equals((object)subject2);
            var hashCode1 = subject1.GetHashCode();
            var hashCode2 = subject2.GetHashCode();

            result1.Should().BeTrue();
            result2.Should().BeTrue();
            hashCode1.Should().Be(hashCode2);
        }
Exemple #4
0
        public void Equals_should_return_false_when_any_fields_are_not_equal()
        {
            var subject1 = new WriteConcern.WMode("mode1");
            var subject2 = new WriteConcern.WMode("mode2");

            var result1   = subject1.Equals(subject2);
            var result2   = subject1.Equals((object)subject2);
            var hashCode1 = subject1.GetHashCode();
            var hashCode2 = subject2.GetHashCode();

            result1.Should().BeFalse();
            result2.Should().BeFalse();
            hashCode1.Should().NotBe(hashCode2);
        }