Ejemplo n.º 1
0
        public void CannotReadPartialRecording()
        {
            var recorder = new JsonRecorder();

            recorder.WriteStartArray();
            recorder.CreatePlayer();
        }
Ejemplo n.º 2
0
        public void AutoCompletion()
        {
            JsonRecorder writer = new JsonRecorder();

            writer.WriteStartArray();
            writer.WriteStartObject();
            writer.WriteMember("outer");
            writer.WriteStartObject();
            writer.WriteMember("inner");
            writer.AutoComplete();

            JsonReader reader = writer.CreatePlayer();

            reader.ReadToken(JsonTokenClass.Array);
            reader.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("outer", reader.ReadMember());
            reader.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("inner", reader.ReadMember());
            reader.ReadNull();
            reader.ReadToken(JsonTokenClass.EndObject);
            reader.ReadToken(JsonTokenClass.EndObject);
            reader.ReadToken(JsonTokenClass.EndArray);
            Assert.IsTrue(reader.EOF);
        }
Ejemplo n.º 3
0
        public void AutoCompletion()
        {
            JsonRecorder writer = new JsonRecorder();

            writer.WriteStartArray();
            writer.WriteStartObject();
            writer.WriteMember("outer");
            writer.WriteStartObject();
            writer.WriteMember("inner");
            writer.AutoComplete();

            JsonReader reader = writer.CreatePlayer();

            reader.ReadToken(JsonTokenClass.Array);
            reader.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("outer", reader.ReadMember());
            reader.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("inner", reader.ReadMember());
            reader.ReadNull();
            reader.ReadToken(JsonTokenClass.EndObject);
            reader.ReadToken(JsonTokenClass.EndObject);
            reader.ReadToken(JsonTokenClass.EndArray);
            Assert.IsTrue(reader.EOF);
        }
Ejemplo n.º 4
0
 public void CannotReadPartialRecording()
 {
     JsonRecorder recorder = new JsonRecorder();
     recorder.WriteStartArray();
     recorder.CreatePlayer();
 }