< Summary

Information
Class: Elsa.Workflows.Activities.Break
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Activities/Break.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 27
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%
ExecuteAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Activities/Break.cs

#LineLine coverage
 1using System.Runtime.CompilerServices;
 2using Elsa.Extensions;
 3using Elsa.Workflows.Attributes;
 4using Elsa.Workflows.Signals;
 5using JetBrains.Annotations;
 6
 7namespace Elsa.Workflows.Activities;
 8
 9/// <summary>
 10/// Break out of a loop.
 11/// </summary>
 12[Activity("Elsa", "Looping", "Break out of a loop.")]
 13[PublicAPI]
 14public class Break : CodeActivity, ITerminalNode
 15{
 16    /// <inheritdoc />
 317    public Break([CallerFilePath] string? source = null, [CallerLineNumber] int? line = null) : base(source, line)
 18    {
 319    }
 20
 21    /// <inheritdoc />
 22    protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
 23    {
 24        // Send a signal to the parent scope to break out of the loop.
 225        await context.SendSignalAsync(new BreakSignal());
 226    }
 27}