public void TestReadStringElement()
        {
            byte[]       buf    = HexToBytes("027465737400050000007465737400");
            MemoryStream ms     = new MemoryStream(buf);
            BsonReader   reader = new BsonReader(ms);
            Document     doc    = new Document();

            reader.ReadElement(doc);
            //Assert.AreEqual(buf.Length,read);
            Assert.IsTrue(doc.Contains("test"));
            Assert.AreEqual("test", (String)doc["test"]);
            Assert.AreEqual(buf.Length, reader.Position);
        }
Пример #2
0
        public void TestReadStringElement()
        {
            byte[] buf = HexToBytes("027465737400050000007465737400");
            MemoryStream ms = new MemoryStream(buf);
            BsonReader reader = new BsonReader(ms);
            Document doc = new Document();

            reader.ReadElement(doc);
            //Assert.AreEqual(buf.Length,read);
            Assert.IsTrue(doc.Contains("test"));
            Assert.AreEqual("test",(String)doc["test"]);
            Assert.AreEqual(buf.Length,reader.Position);
        }