public void ObjectNameLengthExpression_LastItem() { var json = new JsonObject { { "name", new JsonArray { 1, 2, 3 } }, { "name2", new JsonArray { 1, 2, 3 } }, { "test", new JsonArray { 1, 2 } }, }; var path = JsonPathWith.Array(jv => JsonPathRoot.Name("test").Length()); var expected = new JsonArray { new JsonArray { 1, 2 } }; var actual = path.Evaluate(json); Assert.AreEqual(expected, actual); }
public void WhyOnGodsGreenEarthWouldAnyoneDoThis() { _Run(JsonPathWith.Array(jv => 4 + jv.Length() * (JsonPathRoot.Name("name").Length() - 2) + 5), "$[([email protected]*($.name.length-2)+5)]"); }