Esempio n. 1
0
        public void SkipAdjacentObjects()
        {
            MockedJsonReader reader = new MockedJsonReader();

            reader.Begin().Array().Object().EndObject().Object().EndObject().EndArray().End();
            reader.ReadToken(JsonTokenClass.Array);
            reader.Skip();
            Assert.AreEqual(JsonTokenClass.Object, reader.TokenClass);
            reader.Skip();
            reader.ReadToken(JsonTokenClass.EndArray);
        }
Esempio n. 2
0
        public void SkipArray()
        {
            MockedJsonReader reader = new MockedJsonReader();

            reader.Begin().Array().String("test").EndArray().End();
            reader.Skip();
            Assert.IsTrue(reader.EOF);
        }
Esempio n. 3
0
        public void SkipObject()
        {
            MockedJsonReader reader = new MockedJsonReader();

            reader.Begin().Object().Member("foo", "bar").EndObject().End();
            reader.Skip();
            Assert.IsTrue(reader.EOF);
        }
Esempio n. 4
0
        public void SkipScalar()
        {
            var reader = new MockedJsonReader();

            reader.Begin().String("test").End();
            reader.Skip();
            Assert.IsTrue(reader.EOF);
        }
Esempio n. 5
0
        public void SkipArrayElement()
        {
            MockedJsonReader reader = new MockedJsonReader();

            reader.Begin().Array().String("foo").String("bar").EndArray().End();
            reader.Read();
            reader.Read();
            reader.Skip();
            Assert.AreEqual("bar", reader.ReadString());
        }
Esempio n. 6
0
        public void SkipObjectMember()
        {
            MockedJsonReader reader = new MockedJsonReader();

            reader.Begin().Object()
            .Member("m1", "v1")
            .Member("m2").Object()
            .Member("m3", "v3")
            .Member("m4", "v4")
            .EndObject()
            .Member("m5", "v5")
            .EndObject()
            .End();
            reader.Read();
            reader.Read();
            reader.Skip();
            Assert.AreEqual(JsonTokenClass.Member, reader.TokenClass);
            Assert.AreEqual("m2", reader.Text);
            reader.Skip();
            Assert.AreEqual("m5", reader.ReadMember());
        }
Esempio n. 7
0
 public void SkipScalar()
 {
     MockedJsonReader reader = new MockedJsonReader();
     reader.Begin().String("test").End();
     reader.Skip();
     Assert.IsTrue(reader.EOF);
 }
Esempio n. 8
0
 public void SkipObjectMember()
 {
     MockedJsonReader reader = new MockedJsonReader();
     reader.Begin().Object()
         .Member("m1", "v1")
         .Member("m2").Object()
             .Member("m3", "v3")
             .Member("m4", "v4")
             .EndObject()
         .Member("m5", "v5")
         .EndObject()
     .End();
     reader.Read();
     reader.Read();
     reader.Skip();
     Assert.AreEqual(JsonTokenClass.Member, reader.TokenClass);
     Assert.AreEqual("m2", reader.Text);
     reader.Skip();
     Assert.AreEqual("m5", reader.ReadMember());
 }
Esempio n. 9
0
 public void SkipObject()
 {
     MockedJsonReader reader = new MockedJsonReader();
     reader.Begin().Object().Member("foo", "bar").EndObject().End();
     reader.Skip();
     Assert.IsTrue(reader.EOF);
 }
Esempio n. 10
0
 public void SkipArrayElement()
 {
     MockedJsonReader reader = new MockedJsonReader();
     reader.Begin().Array().String("foo").String("bar").EndArray().End();
     reader.Read();
     reader.Read();
     reader.Skip();
     Assert.AreEqual("bar", reader.ReadString());
 }
Esempio n. 11
0
 public void SkipAdjacentObjects()
 {
     MockedJsonReader reader = new MockedJsonReader();
     reader.Begin().Array().Object().EndObject().Object().EndObject().EndArray().End();
     reader.ReadToken(JsonTokenClass.Array);
     reader.Skip();
     Assert.AreEqual(JsonTokenClass.Object, reader.TokenClass);
     reader.Skip();
     reader.ReadToken(JsonTokenClass.EndArray);
 }