-Fixed settings not being used when deserializing F# unions

This commit is contained in:
James Newton-King
2014-11-05 16:25:57 -08:00
parent 52d54d50e7
commit d316425746
8 changed files with 181 additions and 8 deletions
@@ -54,6 +54,52 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
[TestFixture]
public class JPathExecuteTests : TestFixtureBase
{
[Test]
public void ParseWithEmptyArrayContent()
{
var json = @"{
'controls': [
{
'messages': {
'addSuggestion': {
'en-US': 'Add'
}
}
},
{
'header': {
'controls': []
},
'controls': [
{
'controls': [
{
'defaultCaption': {
'en-US': 'Sort by'
},
'sortOptions': [
{
'label': {
'en-US': 'Name'
}
}
]
}
]
}
]
}
]
}";
JObject jToken = JObject.Parse(json);
IList<JToken> tokens = jToken.SelectTokens("$..en-US").ToList();
Assert.AreEqual(3, tokens.Count);
Assert.AreEqual("Add", (string)tokens[0]);
Assert.AreEqual("Sort by", (string)tokens[1]);
Assert.AreEqual("Name", (string)tokens[2]);
}
[Test]
public void SelectTokenAfterEmptyContainer()
{