public void TestRemoveElement() { var wrapper = new BsonDocumentWrapper(new BsonDocument { { "x", 1 }, { "y", 2 } }); Assert.AreEqual(false, wrapper.IsMaterialized); wrapper.RemoveElement(new BsonElement("y", 2)); Assert.AreEqual(true, wrapper.IsMaterialized); Assert.AreEqual(1, wrapper.ElementCount); Assert.AreEqual("x", wrapper.GetElement(0).Name); Assert.AreEqual(new BsonInt32(1), wrapper[0]); }