示例#1
0
 [Test] public void json()
 {
     Assert.AreEqual(Obj_Int.json(), Json_Int);
     Assert.AreEqual(Obj_String.json(), Json_String);
     Assert.AreEqual(Obj_List.json(), Json_List);
     Assert.IsNull(Obj_Null.json(), Json_List);
 }
示例#2
0
        [Test] public void javascript_Deserialize()
        {
            Assert.AreEqual(Obj_Int.javascript_Serialize().javascript_Deserialize(), Obj_Int);
            Assert.AreEqual(Obj_String.javascript_Serialize().javascript_Deserialize(), Obj_String);
            Assert.AreEqual(Obj_List.javascript_Serialize().javascript_Deserialize(), Obj_List);
            Assert.AreEqual(Obj_Null.javascript_Serialize().javascript_Deserialize(), Obj_Null);

            Assert.AreEqual(Json_Int.javascript_Deserialize <int>          (), Obj_Int);
            Assert.AreEqual(Json_Int.javascript_Deserialize <Int32>        (), Obj_Int);
            Assert.AreEqual(Json_String.javascript_Deserialize <string>       (), Obj_String);
            Assert.AreEqual(Json_String.javascript_Deserialize <String>       (), Obj_String);
            Assert.AreEqual(Json_List.javascript_Deserialize <List <String> > (), Obj_List);

            Assert.AreEqual(Json_Int.javascript_Deserialize <StringBuilder>(), null);
            Assert.AreEqual(Json_String.javascript_Deserialize <StringBuilder>(), null);
            Assert.AreEqual(Json_List.javascript_Deserialize <StringBuilder>(), null);
        }