Exemplo n.º 1
0
        public void Test_JsonH_StringCompress()
        {
            var json = FileUtil.Read("D:\\iTestRunner_R1.txt");
            List <Dictionary <string, object> > unpacked = json.ToObject <List <Dictionary <string, object> > >();

            Output.WriteLine(JSONH.pack(unpacked, 0).ToJson());
        }
Exemplo n.º 2
0
        public void Test_JsonH()
        {
            string s = "[{\"name\":\"Andrea\",age:31,\"gender\":\"Male\",\"skilled\":true},{\"name\":\"Eva\",\"age\":27,\"gender\":\"Female\",\"skilled\":true},{\"name\":\"Daniele\",\"age\":26,\"gender\":\"Male\",\"skilled\":false}]";
            List <Dictionary <string, object> > unpacked = s.ToObject <List <Dictionary <string, object> > >();

            Output.WriteLine(JSONH.pack(unpacked, 0).ToJson());
            Output.WriteLine(JSONH.pack(unpacked, 1).ToJson());
            Output.WriteLine(JSONH.pack(unpacked, 2).ToJson());
            Output.WriteLine(JSONH.pack(unpacked, 3).ToJson());
            Output.WriteLine(JSONH.pack(unpacked, 4).ToJson());
            Output.WriteLine(JSONH.pack(unpacked, 0).ToJson().Length.ToString());
            Output.WriteLine(JSONH.pack(unpacked, 1).ToJson().Length.ToString());
            Output.WriteLine(JSONH.pack(unpacked, 2).ToJson().Length.ToString());
            Output.WriteLine(JSONH.pack(unpacked, 3).ToJson().Length.ToString());
            Output.WriteLine(JSONH.pack(unpacked, 4).ToJson().Length.ToString());
            Output.WriteLine(JSONH.unpack(JSONH.pack(unpacked, 0).ToJson().ToObject <List <List <object> > >()).ToJson());
        }