Exemplo n.º 1
0
        public void ToBsonValue_should_return_proper_value()
        {
            var wMode     = new WriteConcern.WMode("mode");
            var bsonValue = wMode.ToBsonValue();

            bsonValue.Should().BeOfType <BsonString>();
            bsonValue.AsString.Should().Be("mode");
        }
Exemplo n.º 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());
        }
Exemplo n.º 3
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());
        }
Exemplo n.º 4
0
        public void ToString_should_return_proper_value()
        {
            var wMode = new WriteConcern.WMode("mode");

            wMode.ToString().Should().Be("\"mode\"");
        }
Exemplo n.º 5
0
        public void Constructor_should_initialize_instance()
        {
            var mode = new WriteConcern.WMode("mode");

            mode.Value.Should().Be("mode");
        }