public void TestClassWithBsonStringId()
        {
            _collection.RemoveAll();

            var doc = new ClassWithBsonStringId { Id = null, X = 1 };
            _collection.Insert(doc);
            Assert.IsNull(doc.Id);

            doc = new ClassWithBsonStringId { Id = "", X = 1 };
            _collection.Insert(doc);
            Assert.AreEqual("", doc.Id.AsString);

            doc = new ClassWithBsonStringId { Id = "123", X = 1 };
            _collection.Insert(doc);
        }
Пример #2
0
        public void TestClassWithBsonStringId()
        {
            _collection.RemoveAll();

            var doc = new ClassWithBsonStringId { Id = null, X = 1 };
            _collection.Insert(doc);
            Assert.Null(doc.Id);

            doc = new ClassWithBsonStringId { Id = "", X = 1 };
            _collection.Insert(doc);
            Assert.Equal("", doc.Id.AsString);

            doc = new ClassWithBsonStringId { Id = "123", X = 1 };
            _collection.Insert(doc);
        }