Merge pull request #217 from QuickJack/master
[mono.git] / mcs / class / System.Json / Test / System.Json / JsonValueTest.cs
1 //
2 // JsonValueTest.cs: Tests for JSonValue
3 //
4 // Copyright 2011 Xamarin, Inc.
5 //
6 // Authors:
7 //   Miguel de Icaza
8 //
9 using NUnit.Framework;
10 using System;
11 using System.IO;
12 using System.Text;
13 using System.Json;
14
15 namespace MonoTests.System
16 {
17         [TestFixture]
18         public class JsonValueTests {
19                 // Tests that a trailing comma is allowed in dictionary definitions
20                 [Test]
21                 public void LoadWithTrailingComma ()
22                 {
23                         var j = JsonValue.Load (new StringReader ("{ \"a\": \"b\",}"));
24                         Assert.AreEqual (1, j.Count, "itemcount");
25                         Assert.AreEqual (JsonType.String, j ["a"].JsonType, "type");
26                         Assert.AreEqual ("b", (string) j ["a"], "value");
27                 }
28         }
29 }