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 ''."); }