Esempio n. 1
0
        public void ArrayInObjectTest()
        {
            Fibo f = new Fibo();
            string json = f.ToJsonString();

            Assert.AreEqual("{\"arr\":[1,1,2,3,5]}", json);
        }
Esempio n. 2
0
        public void ArrayInObjectTest()
        {
            Fibo   f    = new Fibo();
            string json = f.ToJsonString();

            Assert.AreEqual("{\"arr\":[1,1,2,3,5]}", json);
        }
Esempio n. 3
0
        public void ArrayInObjectIgnoreTypeSafeTest()
        {
            string s = "{\"arr\":[\"1\",1,2,3,\"5\"]}";

            Fibo f = s.ParseJson <Fibo>(true);

            Assert.AreEqual(1, f.Arr[0]);
            Assert.AreEqual(1, f.Arr[1]);
            Assert.AreEqual(2, f.Arr[2]);
            Assert.AreEqual(3, f.Arr[3]);
            Assert.AreEqual(5, f.Arr[4]);
        }
Esempio n. 4
0
        public void ArrayInObjectTest()
        {
            string s = "{\"arr\":[1,1,2,3,5]}";

            Fibo f = s.ParseJson <Fibo>();

            Assert.AreEqual(1, f.Arr[0]);
            Assert.AreEqual(1, f.Arr[1]);
            Assert.AreEqual(2, f.Arr[2]);
            Assert.AreEqual(3, f.Arr[3]);
            Assert.AreEqual(5, f.Arr[4]);
        }