Exemplo n.º 1
0
        public async Task CloseOutputAsync()
        {
            MemoryStream   ms     = new MemoryStream();
            BsonDataWriter writer = new BsonDataWriter(ms);

            Assert.IsTrue(ms.CanRead);
            await writer.CloseAsync();

            Assert.IsFalse(ms.CanRead);

            ms     = new MemoryStream();
            writer = new BsonDataWriter(ms)
            {
                CloseOutput = false
            };

            Assert.IsTrue(ms.CanRead);
            await writer.CloseAsync();

            Assert.IsTrue(ms.CanRead);
        }