< Summary

Information
Class: Elsa.Workflows.SignalContext
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/SignalContext.cs
Line coverage
90%
Covered lines: 10
Uncovered lines: 1
Coverable lines: 11
Total lines: 44
Line coverage: 90.9%
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_ReceiverActivityExecutionContext()100%11100%
get_SenderActivityExecutionContext()100%11100%
get_IsSelf()100%210%
get_CancellationToken()100%11100%
get_StopPropagationRequested()100%11100%
StopPropagation()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/SignalContext.cs

#LineLine coverage
 1namespace Elsa.Workflows;
 2
 3/// <summary>
 4/// Provides contextual information about a signal.
 5/// </summary>
 6public class SignalContext
 7{
 8    /// <summary>
 9    /// Initializes a new instance of the <see cref="SignalContext"/> class.
 10    /// </summary>
 1218211    public SignalContext(ActivityExecutionContext receiverActivityExecutionContext, ActivityExecutionContext senderActiv
 12    {
 1218213        ReceiverActivityExecutionContext = receiverActivityExecutionContext;
 1218214        SenderActivityExecutionContext = senderActivityExecutionContext;
 1218215        CancellationToken = cancellationToken;
 1218216    }
 17
 18    /// <summary>
 19    /// The <see cref="ActivityExecutionContext"/> receiving the signal.
 20    /// </summary>
 2435821    public ActivityExecutionContext ReceiverActivityExecutionContext { get; init; }
 22
 23    /// <summary>
 24    /// The <see cref="ActivityExecutionContext"/> sending the signal.
 25    /// </summary>
 2435926    public ActivityExecutionContext SenderActivityExecutionContext { get; init; }
 27
 28    /// <summary>
 29    /// Returns true if the receiver is the same as the sender.
 30    /// </summary>
 031    public bool IsSelf => SenderActivityExecutionContext.Activity == ReceiverActivityExecutionContext.Activity;
 32
 33    /// <summary>
 34    /// The cancellation token.
 35    /// </summary>
 1472136    public CancellationToken CancellationToken { get; init; }
 37
 1218538    internal bool StopPropagationRequested { get; private set; }
 39
 40    /// <summary>
 41    /// Stops the signal from propagating further up the activity execution context hierarchy.
 42    /// </summary>
 343    public void StopPropagation() => StopPropagationRequested = true;
 44}