Exemple #1
0
        //[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);
                }
Exemple #2
0
 public static IPathSegment ParseAsJsonPath(this string jsonPath) => JsonPathFactory.Parse(jsonPath);