public void TestFunctions()
 {
     TestParse(
         "Exists($(foo)) And !HasTrailingSlash ('$(foobar)')",
         new ExpressionConditionOperator(
             ExpressionOperatorKind.And,
             new ExpressionConditionFunction(
                 0, 14, "Exists",
                 new ExpressionArgumentList(
                     6, 8,
                     new ExpressionProperty(7, "foo")
                     )
                 ),
             ExpressionConditionOperator.Not(
                 19,
                 new ExpressionConditionFunction(
                     20, 30, "HasTrailingSlash",
                     new ExpressionArgumentList(
                         37, 13,
                         new QuotedExpression('\'', new ExpressionProperty(39, "foobar"))
                         )
                     )
                 )
             )
         );
 }
 public void TestNotBool()
 {
     TestParse(
         " !false ",
         ExpressionConditionOperator.Not(1, new ExpressionArgumentBool(2, false))
         );
 }
 public void TestChainedBoolean()
 {
     TestParse(
         "true and false or !true and !false",
         new ExpressionConditionOperator(ExpressionOperatorKind.And,
                                         new ExpressionConditionOperator(ExpressionOperatorKind.Or,
                                                                         new ExpressionConditionOperator(ExpressionOperatorKind.And,
                                                                                                         new ExpressionArgumentBool(0, true),
                                                                                                         new ExpressionArgumentBool(9, false)
                                                                                                         ),
                                                                         ExpressionConditionOperator.Not(18, new ExpressionArgumentBool(19, true))
                                                                         ),
                                         ExpressionConditionOperator.Not(28, new ExpressionArgumentBool(29, false))
                                         )
         );
 }
 public void TestParenGrouping()
 {
     TestParse(
         "true and ((false or $(foo)=='bar') and !('$(baz.Length)'==5)) and 'thing' != 'other thing'",
         new ExpressionConditionOperator(ExpressionOperatorKind.And,
                                         new ExpressionConditionOperator(ExpressionOperatorKind.And,
                                                                         new ExpressionArgumentBool(0, true),
                                                                         new ExpressionParenGroup(9, 52,
                                                                                                  new ExpressionConditionOperator(ExpressionOperatorKind.And,
                                                                                                                                  new ExpressionParenGroup(10, 24,
                                                                                                                                                           new ExpressionConditionOperator(ExpressionOperatorKind.Or,
                                                                                                                                                                                           new ExpressionArgumentBool(11, false),
                                                                                                                                                                                           new ExpressionConditionOperator(ExpressionOperatorKind.Equal,
                                                                                                                                                                                                                           new ExpressionProperty(20, "foo"),
                                                                                                                                                                                                                           new QuotedExpression('\'', new ExpressionText(29, "bar", true))
                                                                                                                                                                                                                           )
                                                                                                                                                                                           )
                                                                                                                                                           ),
                                                                                                                                  ExpressionConditionOperator.Not(39,
                                                                                                                                                                  new ExpressionParenGroup(40, 20,
                                                                                                                                                                                           new ExpressionConditionOperator(ExpressionOperatorKind.Equal,
                                                                                                                                                                                                                           new QuotedExpression('\'',
                                                                                                                                                                                                                                                new ExpressionProperty(42, 13,
                                                                                                                                                                                                                                                                       new ExpressionPropertyFunctionInvocation(44, 10,
                                                                                                                                                                                                                                                                                                                new ExpressionPropertyName(44, "baz"),
                                                                                                                                                                                                                                                                                                                new ExpressionFunctionName(48, "Length"),
                                                                                                                                                                                                                                                                                                                null
                                                                                                                                                                                                                                                                                                                )
                                                                                                                                                                                                                                                                       )
                                                                                                                                                                                                                                                ),
                                                                                                                                                                                                                           new ExpressionArgumentInt(58, 1, 5)
                                                                                                                                                                                                                           )
                                                                                                                                                                                           )
                                                                                                                                                                  )
                                                                                                                                  )
                                                                                                  )
                                                                         ),
                                         new ExpressionConditionOperator(ExpressionOperatorKind.NotEqual,
                                                                         new QuotedExpression('\'', new ExpressionText(67, "thing", true)),
                                                                         new QuotedExpression('\'', new ExpressionText(78, "other thing", true))
                                                                         )
                                         )
         );
 }