< Summary

Information
Class: Elsa.Alterations.AlterationHandlers.CancelHandler
Assembly: Elsa.Alterations
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations/AlterationHandlers/CancelHandler.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 22
Line coverage: 0%
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
HandleAsync(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations/AlterationHandlers/CancelHandler.cs

#LineLine coverage
 1using Elsa.Alterations.AlterationTypes;
 2using Elsa.Alterations.Core.Abstractions;
 3using Elsa.Alterations.Core.Contexts;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Alterations.AlterationHandlers;
 7
 8/// <summary>
 9/// Upgrades the version of the workflow instance.
 10/// </summary>
 11[UsedImplicitly]
 12public class CancelHandler : AlterationHandlerBase<Cancel>
 13{
 14    /// <inheritdoc />
 15    protected override ValueTask HandleAsync(AlterationContext context, Cancel alteration)
 16    {
 017        context.WorkflowExecutionContext.Cancel();
 18
 019        context.Succeed();
 020        return ValueTask.CompletedTask;
 21    }
 22}