-Added support for MS format JSON dates to ReadAsDateTime
-Fixed parsing certain JSON with comments into a JObject -Tests
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user