예제 #1
0
        public void TestBsonTimestampEquals()
        {
            BsonTimestamp lhs = new BsonTimestamp(1L);
            BsonTimestamp rhs = new BsonTimestamp(1L);

            Assert.NotSame(lhs, rhs);
            Assert.Equal(lhs, rhs);
            Assert.Equal(lhs.GetHashCode(), rhs.GetHashCode());
        }
예제 #2
0
        public void Equals_should_return_false_when_values_are_not_equal(long value1, long value2)
        {
            var subject = new BsonTimestamp(value1);
            var other   = new BsonTimestamp(value2);

            var result1         = subject.Equals(other);
            var result2         = subject.Equals((object)other);
            var subjectHashCode = subject.GetHashCode();
            var otherHashCode   = other.GetHashCode();

            result1.Should().BeFalse();
            result2.Should().BeFalse();
            otherHashCode.Should().NotBe(subjectHashCode);
        }
예제 #3
0
        public void Equals_should_return_true_when_values_are_equal(long value)
        {
            var subject = new BsonTimestamp(value);
            var other   = new BsonTimestamp(value);

            other.Should().NotBeSameAs(subject);

            var result1         = subject.Equals(other);
            var result2         = subject.Equals((object)other);
            var subjectHashCode = subject.GetHashCode();
            var otherHashCode   = other.GetHashCode();

            result1.Should().BeTrue();
            result2.Should().BeTrue();
            otherHashCode.Should().Be(subjectHashCode);
        }
예제 #4
0
 public void TestBsonTimestampEquals()
 {
     BsonTimestamp lhs = new BsonTimestamp(1L);
     BsonTimestamp rhs = new BsonTimestamp(1L);
     Assert.NotSame(lhs, rhs);
     Assert.Equal(lhs, rhs);
     Assert.Equal(lhs.GetHashCode(), rhs.GetHashCode());
 }
예제 #5
0
        public void Equals_should_return_true_when_values_are_equal(long value)
        {
            var subject = new BsonTimestamp(value);
            var other = new BsonTimestamp(value);
            other.Should().NotBeSameAs(subject);

            var result1 = subject.Equals(other);
            var result2 = subject.Equals((object)other);
            var subjectHashCode = subject.GetHashCode();
            var otherHashCode = other.GetHashCode();

            result1.Should().BeTrue();
            result2.Should().BeTrue();
            otherHashCode.Should().Be(subjectHashCode);
        }
예제 #6
0
        public void Equals_should_return_false_when_values_are_not_equal(long value1, long value2)
        {
            var subject = new BsonTimestamp(value1);
            var other = new BsonTimestamp(value2);

            var result1 = subject.Equals(other);
            var result2 = subject.Equals((object)other);
            var subjectHashCode = subject.GetHashCode();
            var otherHashCode = other.GetHashCode();

            result1.Should().BeFalse();
            result2.Should().BeFalse();
            otherHashCode.Should().NotBe(subjectHashCode);
        }