public static RunStatusTransition GetTransition(RunUserAgentResult source, RunUserAgentResult target)
        {
            if (source == null) return new RunStatusTransition(0, "No Result For Source", x => false, x => false, "gradeU");
            if (target == null) return new RunStatusTransition(0, "No Result For Target", x => false, x => false, "gradeU");

            return GetAll<RunStatusTransition>().Where(x => x._source(source.Status) && x._target(target.Status)).SingleOrDefault() ?? NoChange;
        }
Beispiel #2
0
        public RunUserAgent(Run run, UserAgent userAgent, int? maxRuns = 1)
        {
            Run = run;
            UserAgent = userAgent;
            RunStatus = RunStatusType.NotStarted;

            RemainingRuns = MaxRuns = maxRuns.GetValueOrDefault();
            Result = new RunUserAgentResult();
        }
Beispiel #3
0
        public void Pass(ClientRun clientRun)
        {
            RemainingRuns = 0;
            ActiveClientId = null;
            RunStatus = RunStatusType.Finished;

            Result = new RunUserAgentResult(clientRun);
        }
Beispiel #4
0
        public void Fail(ClientRun clientRun)
        {
            RemainingRuns--;
            ActiveClientId = null;
            RunStatus = RemainingRuns > 0 ? RunStatusType.Running : RunStatusType.Finished;

            Result = new RunUserAgentResult(clientRun);
        }
Beispiel #5
0
 public void Reset()
 {
     ActiveClientId = null;
     RunStatus = RunStatusType.NotStarted;
     RemainingRuns = MaxRuns;
     Result = new RunUserAgentResult();
 }