Ejemplo n.º 1
0
        public async Task Run_throws_InvalidPipelineConfigurationException_if_there_is_a_dependency_to_task_not_added_to_the_pipeline_02()
        {
            // ARRANGE
            var tasks = new IChangeLogTask[]
            {
                new TestTask12(),
            };
            var sut = new ChangeLogPipeline(m_Logger, tasks);

            // ACT
            var ex = await Record.ExceptionAsync(async() => await sut.RunAsync());

            // ASSERT
            Assert.IsType <InvalidPipelineConfigurationException>(ex);
            Assert.Equal("Dependent task 'TestTask13' of task 'TestTask12' was not found", ex.Message);
        }
Ejemplo n.º 2
0
        public async Task Run_throws_InvalidPipelineConfigurationException_if_there_are_cyclic_dependencies_between_tasks_01()
        {
            // ARRANGE
            var tasks = new IChangeLogTask[]
            {
                new TestTask5()
            };
            var sut = new ChangeLogPipeline(m_Logger, tasks);

            // ACT
            var ex = await Record.ExceptionAsync(async() => await sut.RunAsync());

            // ASSERT
            Assert.IsType <InvalidPipelineConfigurationException>(ex);
            Assert.Equal("Detected circular dependency between tasks: 'TestTask5' -> 'TestTask5'", ex.Message);
        }
Ejemplo n.º 3
0
 private string GetTaskName(IChangeLogTask task) => task.GetType().Name;
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of <see cref="ChangeLogTaskExecutionResult"/>
 /// </summary>
 /// <param name="task">The task this result belongs to.</param>
 /// <param name="result">The result of the task's execution.</param>
 public ChangeLogTaskExecutionResult(IChangeLogTask task, ChangeLogTaskResult result)
 {
     Task   = task ?? throw new ArgumentNullException(nameof(task));
     Result = result;
 }