-Added JsonLoadSettings

-Added CommentsHandling
-Changed LINQ to JSON load to ignore array comments by default
This commit is contained in:
James Newton-King
2015-10-06 22:17:25 +13:00
parent 172c1d8f30
commit 2bf31b9605
22 changed files with 366 additions and 68 deletions
@@ -544,5 +544,21 @@ Parameter name: index");
l = decks.ToList();
Assert.AreEqual(1, l.Count);
}
[Test]
public void Parse_NoComments()
{
string json = "[1,2/*comment*/,3]";
JArray a = JArray.Parse(json, new JsonLoadSettings
{
CommentHandling = CommentHandling.Ignore
});
Assert.AreEqual(3, a.Count);
Assert.AreEqual(1, (int)a[0]);
Assert.AreEqual(2, (int)a[1]);
Assert.AreEqual(3, (int)a[2]);
}
}
}