public async Task SequentialTasksExecuteInSequence() { var task = new SequentialTask(this.tasks); await task.ExecuteAsync(this.Context); Assert.Equal(1, this.maxExecuting); }
/// <summary> /// Executes the loader task sequence. /// </summary> /// <remarks> /// Note: This executes the supplied list in sequence. If parallel /// execution is needed then create ParallelTasks in this list. /// </remarks> /// <param name="tasks">A sequence of tasks to execute.</param> /// <returns>A task representing the completion of this function.</returns> private static async Task ExecuteAsync(IEnumerable <ITask> tasks) { var mainTask = new SequentialTask("Main", tasks); var context = new TaskContext(Program.CancellationTokenSource); await mainTask.VerifyAsync(context); await mainTask.ExecuteAsync(context); }