public void TestSetup() { state = new SchedulerState(Task.CompletedTask, CancellationToken.None); job = Substitute.For <IStreamJob>(); launcher = Substitute.For <IJobLauncher>(); handler = new JobHandler(launcher); }
public void LaunchSendJob(IStreamJob job, SchedulerState state) => state.SendingJobs.Add(job.SendAsync(state.CancellationToken).ContinueWith(_ => new SendingJobResult(job)));
public void LaunchWaitJob(IStreamJob job, SchedulerState state) => state.WaitingJobs.Add(job.WaitForNextSendAsync(state.CancellationToken).ContinueWith(_ => new WaitingJobResult(job)));
public WaitingJobResult([NotNull] IStreamJob job) => Job = job;
public SendingJobResult([NotNull] IStreamJob job) => Job = job;