< Summary

Information
Class: Elsa.Workflows.Pipelines.WorkflowExecution.WorkflowExecutionPipeline
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Pipelines/WorkflowExecution/WorkflowExecutionPipeline.cs
Line coverage
80%
Covered lines: 12
Uncovered lines: 3
Coverable lines: 15
Total lines: 42
Line coverage: 80%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Pipeline()50%22100%
get_ConfigurePipelineBuilder()100%11100%
Setup(...)100%11100%
ExecuteAsync()100%11100%
CreateDefaultPipeline()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Pipelines/WorkflowExecution/WorkflowExecutionPipeline.cs

#LineLine coverage
 1using Elsa.Workflows.Middleware.Workflows;
 2
 3namespace Elsa.Workflows.Pipelines.WorkflowExecution;
 4
 5/// <inheritdoc />
 6public class WorkflowExecutionPipeline : IWorkflowExecutionPipeline
 7{
 8    private readonly IServiceProvider _serviceProvider;
 9    private WorkflowMiddlewareDelegate? _pipeline;
 10
 11    /// <summary>
 12    /// Initializes a new instance of the <see cref="WorkflowExecutionPipeline"/> class.
 13    /// </summary>
 42114    public WorkflowExecutionPipeline(IServiceProvider serviceProvider, Action<IWorkflowExecutionPipelineBuilder> configu
 15    {
 42116        _serviceProvider = serviceProvider;
 42117        ConfigurePipelineBuilder = configurePipelineBuilder;
 42118        Setup(configurePipelineBuilder);
 42119    }
 20
 21    /// <inheritdoc />
 43622    public WorkflowMiddlewareDelegate Pipeline => _pipeline ??= CreateDefaultPipeline();
 23
 24    /// <inheritdoc />
 425    public Action<IWorkflowExecutionPipelineBuilder> ConfigurePipelineBuilder { get; }
 26
 27    /// <inheritdoc />
 28    public WorkflowMiddlewareDelegate Setup(Action<IWorkflowExecutionPipelineBuilder> setup)
 29    {
 42130        var builder = new WorkflowExecutionPipelineBuilder(_serviceProvider);
 42131        setup(builder);
 42132        _pipeline = builder.Build();
 42133        return _pipeline;
 34    }
 35
 36    /// <inheritdoc />
 43637    public async Task ExecuteAsync(WorkflowExecutionContext context) => await Pipeline(context);
 38
 039    private WorkflowMiddlewareDelegate CreateDefaultPipeline() => Setup(x => x
 040        .UseExceptionHandling()
 041        .UseDefaultActivityScheduler());
 42}