public void WriteComment() { ExceptionAssert.Throws<JsonWriterException>("Cannot write JSON comment as BSON. Path ''.", () => { MemoryStream ms = new MemoryStream(); BsonWriter writer = new BsonWriter(ms); writer.WriteStartArray(); writer.WriteComment("fail"); }); }