public void ImportNonObjectMember()
        {
            var surrogate = new Surrogate(new object());
            var context   = new ImportContext();

            surrogate.Import(context, "foo", JsonText.CreateReader("bar"));
            var tail = surrogate.CreateObject(context).TailReader;

            tail.ReadToken(JsonTokenClass.Object);
            Assert.AreEqual("foo", tail.ReadMember());
            Assert.AreEqual("bar", tail.ReadString());
            tail.ReadToken(JsonTokenClass.EndObject);
        }
        public void CannotImportNonObjectMemberWithNullReader()
        {
            var surrogate = new Surrogate(new object());

            surrogate.Import(new ImportContext(), "foo", null);
        }
        public void CannotImportNonObjectMemberWithNullContext()
        {
            var surrogate = new Surrogate(new object());

            surrogate.Import(null, "foo", StockJsonBuffers.EmptyObject.CreateReader());
        }
 public void ImportNonObjectMember()
 {
     Surrogate surrogate = new Surrogate(new object());
     ImportContext context = new ImportContext();
     surrogate.Import(context, "foo", JsonText.CreateReader("bar"));
     JsonReader tail = surrogate.CreateObject(context).TailReader;
     tail.ReadToken(JsonTokenClass.Object);
     Assert.AreEqual("foo", tail.ReadMember());
     Assert.AreEqual("bar", tail.ReadString());
     tail.ReadToken(JsonTokenClass.EndObject);
 }
 public void CannotImportNonObjectMemberWithNullReader()
 {
     Surrogate surrogate = new Surrogate(new object());
     surrogate.Import(new ImportContext(), "foo", null);
 }
 public void CannotImportNonObjectMemberWithNullContext()
 {
     Surrogate surrogate = new Surrogate(new object());
     surrogate.Import(null, "foo", StockJsonBuffers.EmptyObject.CreateReader());
 }