< Summary

Information
Class: Elsa.Workflows.Pipelines.ActivityExecution.ActivityExecutionPipeline
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Pipelines/ActivityExecution/ActivityExecutionPipeline.cs
Line coverage
58%
Covered lines: 10
Uncovered lines: 7
Coverable lines: 17
Total lines: 42
Line coverage: 58.8%
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%
Setup(...)100%11100%
get_Pipeline()50%22100%
ExecuteAsync()100%11100%
CreateDefaultPipeline()100%210%

File(s)

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

#LineLine coverage
 1using Elsa.Workflows.Middleware.Activities;
 2
 3namespace Elsa.Workflows.Pipelines.ActivityExecution;
 4
 5/// <inheritdoc />
 6public class ActivityExecutionPipeline : IActivityExecutionPipeline
 7{
 8    private readonly IServiceProvider _serviceProvider;
 9    private ActivityMiddlewareDelegate? _pipeline;
 10
 11    /// <summary>
 12    /// Constructor.
 13    /// </summary>
 42114    public ActivityExecutionPipeline(IServiceProvider serviceProvider, Action<IActivityExecutionPipelineBuilder> pipelin
 15    {
 42116        _serviceProvider = serviceProvider;
 42117        Setup(pipelineBuilder);
 42118    }
 19
 20    /// <inheritdoc />
 21    public ActivityMiddlewareDelegate Setup(Action<IActivityExecutionPipelineBuilder> setup)
 22    {
 42123        var builder = new ActivityExecutionPipelinePipelineBuilder(_serviceProvider);
 42124        setup(builder);
 42125        _pipeline = builder.Build();
 42126        return _pipeline;
 27    }
 28
 29    /// <inheritdoc />
 301930    public ActivityMiddlewareDelegate Pipeline => _pipeline ??= CreateDefaultPipeline();
 31
 32    /// <inheritdoc />
 301933    public async Task ExecuteAsync(ActivityExecutionContext context) => await Pipeline(context);
 34
 035    private ActivityMiddlewareDelegate CreateDefaultPipeline() => Setup(x => x
 036        .UseLogging()
 037        .UseExceptionHandling()
 038        .UseExecutionLogging()
 039        .UseNotifications()
 040        .UseDefaultActivityInvoker()
 041    );
 42}