-Added support for MS format JSON dates to ReadAsDateTime

-Fixed parsing certain JSON with comments into a JObject
-Tests
This commit is contained in:
James Newton-King
2014-03-01 18:31:01 +13:00
parent 0f77cd1b03
commit b43afdcc0a
12 changed files with 328 additions and 57 deletions
@@ -57,6 +57,25 @@ namespace Newtonsoft.Json.Tests.Linq
[TestFixture]
public class JObjectTests : TestFixtureBase
{
[Test]
public void JObjectWithComments()
{
string json = @"{ /*comment2*/
""Name"": /*comment3*/ ""Apple"" /*comment4*/, /*comment5*/
""ExpiryDate"": ""\/Date(1230422400000)\/"",
""Price"": 3.99,
""Sizes"": /*comment6*/ [ /*comment7*/
""Small"", /*comment8*/
""Medium"" /*comment9*/,
/*comment10*/ ""Large""
/*comment11*/ ] /*comment12*/
} /*comment13*/";
JToken o = JToken.Parse(json);
Assert.AreEqual("Apple", (string) o["Name"]);
}
[Test]
public void WritePropertyWithNoValue()
{