< Summary

Information
Class: Elsa.Mediator.Middleware.Command.CommandPipeline
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/Middleware/Command/CommandPipeline.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 33
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
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_Pipeline()100%11100%
Setup(...)100%22100%
InvokeAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/Middleware/Command/CommandPipeline.cs

#LineLine coverage
 1using Elsa.Mediator.Middleware.Command.Contracts;
 2
 3namespace Elsa.Mediator.Middleware.Command;
 4
 5/// <inheritdoc />
 6public class CommandPipeline : ICommandPipeline
 7{
 8    private readonly CommandPipelineBuilder _builder;
 9    private CommandMiddlewareDelegate _pipeline = null!;
 10
 11    /// <summary>
 12    /// Constructor.
 13    /// </summary>
 114    public CommandPipeline(IServiceProvider serviceProvider)
 15    {
 116        _builder = new(serviceProvider);
 217        Setup(x => x.UseCommandInvoker().UseCommandLogging());
 118    }
 19
 20    /// <inheritdoc />
 5521    public CommandMiddlewareDelegate Pipeline => _pipeline;
 22
 23    /// <inheritdoc />
 24    public CommandMiddlewareDelegate Setup(Action<ICommandPipelineBuilder>? setup = null)
 25    {
 126        setup?.Invoke(_builder);
 127        _pipeline = _builder.Build();
 128        return _pipeline;
 29    }
 30
 31    /// <inheritdoc />
 5532    public async Task InvokeAsync(CommandContext context) => await Pipeline(context);
 33}