Ejemplo n.º 1
0
        public override void Verify(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
        {
            CommandCallList childCommands = commandCall.Children;

            childCommands.SetUp(evaluator, resultRecorder);
            childCommands.Execute(evaluator, resultRecorder);
            childCommands.Verify(evaluator, resultRecorder);

            String expression = commandCall.Expression;
            Object result     = evaluator.Evaluate(expression);

            if (result != null && result is Boolean)
            {
                if ((Boolean)result)
                {
                    ProcessTrueResult(commandCall, resultRecorder);
                }
                else
                {
                    ProcessFalseResult(commandCall, resultRecorder);
                }
            }
            else
            {
                throw new InvalidExpressionException("Expression '" + expression + "' did not produce a boolean result (needed for assertTrue).");
            }
        }
Ejemplo n.º 2
0
 public CommandCall(ICommand command, Element element, string expression, Resource resource)
 {
     Children = new CommandCallList();
     Command = command;
     Element = element;
     Expression = expression;
     Resource = resource;
 } 
        public void Execute(CommandCall commandCall, global::Concordion.Api.IEvaluator evaluator, global::Concordion.Api.IResultRecorder resultRecorder)
        {
            CommandCallList childCommands = commandCall.Children;

            childCommands.SetUp(evaluator, resultRecorder);
            evaluator.Evaluate(commandCall.Expression);
            childCommands.Execute(evaluator, resultRecorder);
            childCommands.Verify(evaluator, resultRecorder);
        }