public void RootReference() { var expression = (JsonPathPropertyExpression)JsonPathGrammar.Parse("foo"); Assert.IsNull(expression.Target); Assert.AreEqual("foo", expression.Name); }
public Task ProcessOutput(ApiResponseModel response, ApiOutputModel output) { var expression = JsonPathGrammar.Parse(output.Expression); var value = expression.Evaluate(response.JsonResponse); output.Value = value; return(TaskConstants.Completed); }
public void Indexer() { var expression = (JsonPathIndexerExpression)JsonPathGrammar.Parse("foo[10]"); var target = (JsonPathPropertyExpression)expression.Target; Assert.IsNull(target.Target); Assert.AreEqual("foo", target.Name); Assert.AreEqual(10, expression.Index); }
public void SubReference() { var expression = (JsonPathPropertyExpression)JsonPathGrammar.Parse("foo.bar"); var target = (JsonPathPropertyExpression)expression.Target; Assert.IsNull(target.Target); Assert.AreEqual("foo", target.Name); Assert.AreEqual("bar", expression.Name); }