//[DataRow("$..book[?(@.author =~ /.*REES/i)]", "")] public void ParserTest(string query, object expected) { try { var result = JsonPathFactory.Parse(query); this.TestContext.WriteLine($"\"{query}\" == \"{result}\""); Assert.AreEqual(expected, result.ToString()); } catch (Exception ex) { if (expected is Type type && type.IsInstanceOfType(ex)) { //Expected! Assert.IsTrue(true); }
public static IPathSegment ParseAsJsonPath(this string jsonPath) => JsonPathFactory.Parse(jsonPath);