public void ArrayInObjectTest() { Fibo f = new Fibo(); string json = f.ToJsonString(); Assert.AreEqual("{\"arr\":[1,1,2,3,5]}", json); }
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]); }
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]); }