-Added SpecialPropertiesHandling
This commit is contained in:
@@ -44,6 +44,21 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
[TestFixture]
|
||||
public class JTokenReaderTest : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void ErrorTokenIndex()
|
||||
{
|
||||
JObject json = JObject.Parse(@"{""IntList"":[1, ""two""]}");
|
||||
|
||||
ExceptionAssert.Throws<Exception>(
|
||||
"Could not convert string to integer: two. Path 'IntList[1]', line 1, position 20.",
|
||||
() =>
|
||||
{
|
||||
JsonSerializer serializer = new JsonSerializer();
|
||||
|
||||
serializer.Deserialize<TraceTestObject>(json.CreateReader());
|
||||
});
|
||||
}
|
||||
|
||||
#if !NET20
|
||||
[Test]
|
||||
public void YahooFinance()
|
||||
|
||||
@@ -49,6 +49,24 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
[TestFixture]
|
||||
public class LinqToJsonTest : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void JPropertyPath()
|
||||
{
|
||||
JObject o = new JObject
|
||||
{
|
||||
{
|
||||
"person",
|
||||
new JObject
|
||||
{
|
||||
{ "$id", 1 }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
JContainer idProperty = o["person"]["$id"].Parent;
|
||||
Assert.AreEqual("person.$id", idProperty.Path);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ForEach()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user