Example #1
0
        private void AssertExpression(string s, object expectedValue)
        {
            SoqlExpression    expr = SoqlParser.ParseExpression(s);
            SoqlPrettyPrinter pp   = new SoqlPrettyPrinter(Console.Out);

            pp.PrintExpression(expr);
            object val = expr.Evaluate(null);

            Console.WriteLine(" = {0} (expected {1})", val, expectedValue);
            Assert.AreEqual(expectedValue, val);
        }
Example #2
0
        public override object Evaluate(ISoqlEvaluateContext context)
        {
            object val = condition.Evaluate(context);

            if (val == null)
            {
                return(null);
            }

            SoqlExpression expr = (bool)val ? ifTrue : ifFalse;

            if (expr == null)
            {
                return(null);
            }
            return(expr.Evaluate(context));
        }