-Formatting
-Build
This commit is contained in:
@@ -765,9 +765,9 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
new JProperty("prop",
|
||||
new JArray(
|
||||
values.Select(v => new JObject(new JProperty("childProp", v)))
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
IList<JToken> t = o.SelectTokens("$.prop[?(@.childProp =='ff2dc672-6e15-4aa2-afb0-18f4f69596ad')]").ToList();
|
||||
Assert.AreEqual(2, t.Count);
|
||||
|
||||
@@ -42,6 +42,7 @@ using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#else
|
||||
using System.Linq;
|
||||
|
||||
#endif
|
||||
|
||||
namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
@@ -479,8 +480,8 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
{
|
||||
JPath path = new JPath("Blah[0]..Two.Three[1].Four");
|
||||
Assert.AreEqual(6, path.Filters.Count);
|
||||
Assert.AreEqual("Blah", ((FieldFilter) path.Filters[0]).Name);
|
||||
Assert.AreEqual(0, ((ArrayIndexFilter) path.Filters[1]).Index);
|
||||
Assert.AreEqual("Blah", ((FieldFilter)path.Filters[0]).Name);
|
||||
Assert.AreEqual(0, ((ArrayIndexFilter)path.Filters[1]).Index);
|
||||
Assert.AreEqual("Two", ((ScanFilter)path.Filters[2]).Name);
|
||||
Assert.AreEqual("Three", ((FieldFilter)path.Filters[3]).Name);
|
||||
Assert.AreEqual(1, ((ArrayIndexFilter)path.Filters[4]).Index);
|
||||
|
||||
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
|
||||
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
|
||||
#else
|
||||
using NUnit.Framework;
|
||||
|
||||
#endif
|
||||
|
||||
namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
@@ -80,29 +81,29 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
|
||||
JObject o1 = new JObject
|
||||
{
|
||||
{"Title","Title!"},
|
||||
{"FirstName", "FirstName!"},
|
||||
{"LastName", "LastName!"}
|
||||
{ "Title", "Title!" },
|
||||
{ "FirstName", "FirstName!" },
|
||||
{ "LastName", "LastName!" }
|
||||
};
|
||||
|
||||
Assert.IsTrue(compositeExpression.IsMatch(o1));
|
||||
|
||||
JObject o2 = new JObject
|
||||
{
|
||||
{"Title","Title!"},
|
||||
{"FirstName", "FirstName!"}
|
||||
{ "Title", "Title!" },
|
||||
{ "FirstName", "FirstName!" }
|
||||
};
|
||||
|
||||
Assert.IsFalse(compositeExpression.IsMatch(o2));
|
||||
|
||||
JObject o3 = new JObject
|
||||
{
|
||||
{"Title","Title!"}
|
||||
{ "Title", "Title!" }
|
||||
};
|
||||
|
||||
Assert.IsFalse(compositeExpression.IsMatch(o3));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void OrExpressionTest()
|
||||
{
|
||||
@@ -138,24 +139,24 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
|
||||
JObject o1 = new JObject
|
||||
{
|
||||
{"Title","Title!"},
|
||||
{"FirstName", "FirstName!"},
|
||||
{"LastName", "LastName!"}
|
||||
{ "Title", "Title!" },
|
||||
{ "FirstName", "FirstName!" },
|
||||
{ "LastName", "LastName!" }
|
||||
};
|
||||
|
||||
Assert.IsTrue(compositeExpression.IsMatch(o1));
|
||||
|
||||
JObject o2 = new JObject
|
||||
{
|
||||
{"Title","Title!"},
|
||||
{"FirstName", "FirstName!"}
|
||||
{ "Title", "Title!" },
|
||||
{ "FirstName", "FirstName!" }
|
||||
};
|
||||
|
||||
Assert.IsTrue(compositeExpression.IsMatch(o2));
|
||||
|
||||
JObject o3 = new JObject
|
||||
{
|
||||
{"Title","Title!"}
|
||||
{ "Title", "Title!" }
|
||||
};
|
||||
|
||||
Assert.IsFalse(compositeExpression.IsMatch(o3));
|
||||
@@ -195,4 +196,4 @@ namespace Newtonsoft.Json.Tests.Linq.JsonPath
|
||||
Assert.IsFalse(e2.IsMatch(new JArray(4, 5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user