/// <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; } }
public TestErrorException(string message, Exception inner, Action.Result result) : base(message, inner) { this.result = result; }
public TestErrorException() { result = Action.Result.StopAndCloseBrowser; }