예제 #1
0
        /// <summary>
        /// Update runs the plan.
        ///
        /// If the currently running action returns, upon evaluation, Result.Running, we keep on running that action.
        /// If Result.Failure is returend we start a new sequence.
        /// If Result.Success is returned we go to the next step in the current sequence, or, if at the last step,
        /// start a new sequence.
        /// </summary>
        public void Update()
        {
            Action.Result result = Plan.Peek().Run();

            switch (result)
            {
            case Action.Result.Running:
                break;

            case Action.Result.Failure:
                Plan = getNewPlan();
                break;

            case Action.Result.Success:
                Plan.Pop();
                if (Plan.Count == 0)
                {
                    Plan = getNewPlan();
                }
                break;
            }
        }
예제 #2
0
 public TestErrorException(string message, Exception inner, Action.Result result)
     : base(message, inner)
 {
     this.result = result;
 }
예제 #3
0
 public TestErrorException()
 {
     result = Action.Result.StopAndCloseBrowser;
 }