Ejemplo n.º 1
0
        public async Task WriteConstructorAsync()
        {
            await ExceptionAssert.ThrowsAsync <JsonWriterException>(async() =>
            {
                MemoryStream ms       = new MemoryStream();
                BsonDataWriter writer = new BsonDataWriter(ms);

                await writer.WriteStartArrayAsync();
                await writer.WriteStartConstructorAsync("fail");
            }, "Cannot write JSON constructor as BSON. Path ''.");
        }