WriteStartConstructor() public method

Writes the start of a constructor with the given name.
public WriteStartConstructor ( string name ) : void
name string The name of the constructor.
return void
        public void WriteConstructor()
        {
            ExceptionAssert.Throws<JsonWriterException>(() =>
            {
                MemoryStream ms = new MemoryStream();
                BsonWriter writer = new BsonWriter(ms);

                writer.WriteStartArray();
                writer.WriteStartConstructor("fail");
            }, "Cannot write JSON constructor as BSON. Path ''.");
        }
Beispiel #2
0
        public void WriteConstructor()
        {
            MemoryStream ms = new MemoryStream();
              BsonWriter writer = new BsonWriter(ms);

              writer.WriteStartArray();
              writer.WriteStartConstructor("fail");
        }