< Summary

Information
Class: Elsa.Mediator.Middleware.Command.CommandContext
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/Middleware/Command/CommandContext.cs
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 57
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
.ctor(...)100%11100%
get_Command()100%11100%
get_CommandStrategy()100%11100%
get_Headers()100%11100%
get_ServiceProvider()100%11100%
get_ResultType()100%11100%
get_CancellationToken()100%11100%
get_Result()100%11100%

File(s)

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

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2
 3namespace Elsa.Mediator.Middleware.Command;
 4
 5/// <summary>
 6/// Provides context for a command.
 7/// </summary>
 8public class CommandContext
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the <see cref="CommandContext"/> class.
 12    /// </summary>
 5513    public CommandContext(ICommand command, ICommandStrategy commandStrategy, Type resultType, IDictionary<object, objec
 14    {
 5515        Command = command;
 5516        CommandStrategy = commandStrategy;
 5517        ResultType = resultType;
 5518        Headers = headers;
 5519        ServiceProvider = serviceProvider;
 5520        CancellationToken = cancellationToken;
 5521    }
 22
 23    /// <summary>
 24    /// Gets the command.
 25    /// </summary>
 25326    public ICommand Command { get; init; }
 27
 28    /// <summary>
 29    /// Gets the command strategy.
 30    /// </summary>
 5531    public ICommandStrategy CommandStrategy { get; }
 32
 33    /// <summary>
 34    /// Gets or sets the headers associated with the command context.
 35    /// </summary>
 2236    public IDictionary<object, object> Headers { get; }
 37
 38    /// <summary>
 39    /// Gets the service provider used to resolve services for the command context.
 40    /// </summary>
 5541    public IServiceProvider ServiceProvider { get; }
 42
 43    /// <summary>
 44    /// Gets the result type.
 45    /// </summary>
 11046    public Type ResultType { get; init; }
 47
 48    /// <summary>
 49    /// Gets the cancellation token.
 50    /// </summary>
 16551    public CancellationToken CancellationToken { get; init; }
 52
 53    /// <summary>
 54    /// Gets or sets the result.
 55    /// </summary>
 13256    public object? Result { get; set; }
 57}