< Summary

Information
Class: Elsa.Workflows.Pipelines.ActivityExecution.ActivityExecutionPipelinePipelineBuilder
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Pipelines/ActivityExecution/ActivityExecutionPipelinePipelineBuilder.cs
Line coverage
69%
Covered lines: 9
Uncovered lines: 4
Coverable lines: 13
Total lines: 42
Line coverage: 69.2%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
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_ServiceProvider()100%11100%
Use(...)100%11100%
Insert(...)100%210%
Build()100%44100%
Reset()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Pipelines/ActivityExecution/ActivityExecutionPipelinePipelineBuilder.cs

#LineLine coverage
 1namespace Elsa.Workflows.Pipelines.ActivityExecution;
 2
 3/// <inheritdoc />
 4214public class ActivityExecutionPipelinePipelineBuilder(IServiceProvider serviceProvider) : IActivityExecutionPipelineBuil
 5{
 4216    private readonly IList<Func<ActivityMiddlewareDelegate, ActivityMiddlewareDelegate>> _components = new List<Func<Act
 7
 8    /// <inheritdoc />
 25269    public IServiceProvider ServiceProvider { get; } = serviceProvider;
 10
 11    /// <inheritdoc />
 12    public IActivityExecutionPipelineBuilder Use(Func<ActivityMiddlewareDelegate, ActivityMiddlewareDelegate> middleware
 13    {
 210514        _components.Add(middleware);
 210515        return this;
 16    }
 17
 18    /// <inheritdoc />
 19    public IActivityExecutionPipelineBuilder Insert(int index, Func<ActivityMiddlewareDelegate, ActivityMiddlewareDelega
 20    {
 021        _components.Insert(index, middleware);
 022        return this;
 23    }
 24
 25    /// <inheritdoc />
 26    public ActivityMiddlewareDelegate Build()
 27    {
 342728        ActivityMiddlewareDelegate pipeline = _ => new ValueTask();
 29
 505230        foreach (var component in _components.Reverse())
 210531            pipeline = component(pipeline);
 32
 42133        return pipeline;
 34    }
 35
 36    /// <inheritdoc />
 37    public IActivityExecutionPipelineBuilder Reset()
 38    {
 039        _components.Clear();
 040        return this;
 41    }
 42}