Esempio n. 1
0
        public void ToBsonValue_should_return_proper_value()
        {
            var wCount    = new WriteConcern.WCount(1);
            var bsonValue = wCount.ToBsonValue();

            bsonValue.Should().BeOfType <BsonInt32>();
            bsonValue.AsInt32.Should().Be(1);
        }
Esempio n. 2
0
        public void Equals_should_return_false_if_any_fields_are_not_equal(int w1, int w2)
        {
            var wCount1 = new WriteConcern.WCount(w1);
            var wCount2 = new WriteConcern.WCount(w2);

            wCount1.Equals(wCount2).Should().BeFalse();
            wCount1.Equals((object)wCount2).Should().BeFalse();
            wCount1.GetHashCode().Should().NotBe(wCount2.GetHashCode());
        }
Esempio n. 3
0
        public void Equals_should_return_true_if_all_fields_are_equal(int w)
        {
            var wCount1 = new WriteConcern.WCount(w);
            var wCount2 = new WriteConcern.WCount(w);

            wCount1.Equals(wCount2).Should().BeTrue();
            wCount1.Equals((object)wCount2).Should().BeTrue();
            wCount1.GetHashCode().Should().Be(wCount2.GetHashCode());
        }
Esempio n. 4
0
        public void ToString_should_return_proper_value()
        {
            var wCount = new WriteConcern.WCount(1);

            wCount.ToString().Should().Be("1");
        }
Esempio n. 5
0
        public void Constructor_should_initialize_instance(int w)
        {
            var wCount = new WriteConcern.WCount(w);

            wCount.Value.Should().Be(w);
        }