GetTailReader() public méthode

Gets a reader than can be used to read remaining members, which could include buffered and non-buffered members.
public GetTailReader ( ) : Jayrock.Json.JsonReader
Résultat Jayrock.Json.JsonReader
        public void EmptyTailReading()
        {
            FreeJsonMemberReadingHelper helper = CreateHelper(@"{ y: 456, x: 123, z: 789 }");

            Assert.AreEqual(123, helper.ReadMember("x").ReadNumber().ToInt32());
            Assert.AreEqual(456, helper.ReadMember("y").ReadNumber().ToInt32());
            Assert.AreEqual(789, helper.ReadMember("z").ReadNumber().ToInt32());
            JsonReader tail = helper.GetTailReader();

            tail.ReadToken(JsonTokenClass.EndObject);
            Assert.IsFalse(tail.Read());
        }
        public void TailReading()
        {
            FreeJsonMemberReadingHelper helper = CreateHelper(@"
                { y: 456, 
                  x: 123, 
                  z: 789, 
                  obj1: { foo: bar }, 
                  comment: null, 
                  arr: [ 123, 456, 789 ],
                  obj2: { a: 1, b: 2, }, }");

            Assert.AreEqual(123, helper.ReadMember("x").ReadNumber().ToInt32());
            helper.ReadMember("comment").ReadNull();
            JsonReader reader = helper.BaseReader;

            Assert.AreEqual(JsonTokenClass.Member, reader.TokenClass);
            Assert.AreEqual("arr", reader.Text);
            JsonReader tail = helper.GetTailReader();

            Assert.AreEqual("y", tail.ReadMember());
            Assert.AreEqual(456, tail.ReadNumber().ToInt32());
            Assert.AreEqual("z", tail.ReadMember());
            Assert.AreEqual(789, tail.ReadNumber().ToInt32());
            Assert.AreEqual("obj1", tail.ReadMember());
            tail.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("foo", tail.ReadMember());
            Assert.AreEqual("bar", tail.ReadString());
            tail.ReadToken(JsonTokenClass.EndObject);
            Assert.AreEqual("arr", tail.ReadMember());
            tail.ReadToken(JsonTokenClass.Array);
            Assert.AreEqual(123, tail.ReadNumber().ToInt32());
            Assert.AreEqual(456, tail.ReadNumber().ToInt32());
            Assert.AreEqual(789, tail.ReadNumber().ToInt32());
            tail.ReadToken(JsonTokenClass.EndArray);
            Assert.AreEqual("obj2", tail.ReadMember());
            tail.StepOut();
            Assert.IsFalse(reader.Read());
        }