public async Task WriteCommentAsync() { await ExceptionAssert.ThrowsAsync <JsonWriterException>(async() => { MemoryStream ms = new MemoryStream(); BsonDataWriter writer = new BsonDataWriter(ms); await writer.WriteStartArrayAsync(); await writer.WriteCommentAsync("fail"); }, "Cannot write JSON comment as BSON. Path ''."); }