< Summary

Information
Class: Elsa.Mediator.CommandStrategies.DefaultStrategy
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/CommandStrategies/DefaultStrategy.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 23
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ExecuteAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/CommandStrategies/DefaultStrategy.cs

#LineLine coverage
 1using Elsa.Mediator.Contexts;
 2using Elsa.Mediator.Contracts;
 3using Elsa.Mediator.Extensions;
 4
 5namespace Elsa.Mediator.CommandStrategies;
 6
 7/// <summary>
 8/// Invokes command handlers using the default strategy.
 9/// </summary>
 10public class DefaultStrategy : ICommandStrategy
 11{
 12    /// <inheritdoc />
 13    public async Task<TResult> ExecuteAsync<TResult>(CommandStrategyContext context)
 14    {
 3315        var commandContext = context.CommandContext;
 3316        var command = commandContext.Command;
 3317        var commandType = command.GetType();
 3318        var handleMethod = commandType.GetCommandHandlerMethod();
 3319        var handler = context.Handler;
 20
 3321        return await handler.InvokeAsync<TResult>(handleMethod, commandContext);
 3322    }
 23}

Methods/Properties

ExecuteAsync()