public void GetNormalized_ReturnsSelf()
        {
            var element = new JsonPathFilterExpressionElement("@.name = 'a'");

            var actual = element.GetNormalized();

            actual.Should().Be(element);
        }
        public void Matches_Any(JsonPathElementType type, bool?expected)
        {
            var element = new JsonPathFilterExpressionElement("@.name");
            var other   = ElementCreator.CreateAny(type);

            bool?actual = element.Matches(other);

            actual.Should().Be(expected);
        }
        public void Matches_Expression(string expression, string otherExpression, bool?expected)
        {
            var element = new JsonPathFilterExpressionElement(expression);
            var other   = new JsonPathFilterExpressionElement(otherExpression);

            bool?actual = element.Matches(other);

            actual.Should().Be(expected);
        }
        public void IsNormalized_ReturnsTrue()
        {
            var element = new JsonPathFilterExpressionElement("@.name = 'a'");

            element.IsNormalized.Should().BeTrue();
        }
        public void IsStrict_ReturnsFalse()
        {
            var element = new JsonPathFilterExpressionElement("@.name = 'a'");

            element.IsStrict.Should().BeFalse();
        }
コード例 #6
0
 private static void AppendFilterExpression(this StringBuilder builder, JsonPathFilterExpressionElement element)
 {
     builder.Append("[?(");
     builder.Append(element.Expression);
     builder.Append(")]");
 }