예제 #1
0
        public void Constructor_JArray_Test()
        {
            var jArr = new JArray(1, 2);
            var j    = new WFJson(jArr);

            Assert.AreEqual(j.ToString(), "[1,2]");
        }
예제 #2
0
        public void Constructor_New_Test()
        {
            WFJson j = null;

            j = new WFJson();
            Assert.AreEqual(j.ToString(), "{}", "create a empty JsonObject fail");
        }
예제 #3
0
        public void Constructor_JObject_Test()
        {
            var jobj = new JObject(new JProperty("a", 1));
            var j    = new WFJson(jobj);

            Assert.AreEqual(j.ToString(), "{\"a\":1}", "create a JosnObject with JObject fail");
        }
예제 #4
0
        public void Add_WFJson_Test()
        {
            var j = WFJson.Parse("[]");
            var a = new WFJson("sd");

            j.Add(a);
            Assert.AreEqual(j[0].ToString(), a.ToString());
        }