예제 #1
0
 public void Export()
 {
     JsonArray a = new JsonArray(new object[] { 123, "Hello World", true });
     JsonRecorder writer = new JsonRecorder();
     a.Export(writer);
     JsonReader reader = writer.CreatePlayer();
     reader.ReadToken(JsonTokenClass.Array);
     Assert.AreEqual(a[0], reader.ReadNumber().ToInt32());
     Assert.AreEqual(a[1], reader.ReadString());
     Assert.AreEqual(a[2], reader.ReadBoolean());
     reader.ReadToken(JsonTokenClass.EndArray);
 }
예제 #2
0
        public void Export()
        {
            JsonArray    a      = new JsonArray(new object[] { 123, "Hello World", true });
            JsonRecorder writer = new JsonRecorder();

            a.Export(writer);
            JsonReader reader = writer.CreatePlayer();

            reader.ReadToken(JsonTokenClass.Array);
            Assert.AreEqual(a[0], reader.ReadNumber().ToInt32());
            Assert.AreEqual(a[1], reader.ReadString());
            Assert.AreEqual(a[2], reader.ReadBoolean());
            reader.ReadToken(JsonTokenClass.EndArray);
        }
예제 #3
0
 public void CannotUseNullArgWithExport()
 {
     IJsonExportable array = new JsonArray();
     array.Export(null, null);
 }
예제 #4
0
        public void CannotUseNullArgWithExport()
        {
            IJsonExportable array = new JsonArray();

            array.Export(null, null);
        }