2 // JsonValueTest.cs: Tests for JSonValue
4 // Copyright 2011 Xamarin, Inc.
15 namespace MonoTests.System
18 public class JsonValueTests {
19 // Tests that a trailing comma is allowed in dictionary definitions
20 // Test that we correctly serialize JsonArray with null elements.
22 public void ToStringOnJsonArrayWithNulls () {
23 var j = JsonValue.Load (new StringReader ("[1,2,3,null]"));
24 Assert.AreEqual (4, j.Count, "itemcount");
25 Assert.AreEqual (JsonType.Array, j.JsonType, "type");
26 var str = j.ToString ();
27 Assert.AreEqual ("[1,2,3,null]", str);