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