< Summary

Information
Class: Elsa.Alterations.Endpoints.Alterations.DryRun.DryRun
Assembly: Elsa.Alterations
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Endpoint.cs
Line coverage
50%
Covered lines: 4
Uncovered lines: 4
Coverable lines: 8
Total lines: 28
Line coverage: 50%
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%
Configure()100%11100%
HandleAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Alterations/Endpoints/Alterations/DryRun/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Alterations.Core.Contracts;
 3using Elsa.Alterations.Core.Models;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Alterations.Endpoints.Alterations.DryRun;
 7
 8/// <summary>
 9/// Determines which workflow instances a "Submit" request would target without actually running an alteration.
 10/// </summary>
 11[PublicAPI]
 112public class DryRun(IWorkflowInstanceFinder workflowInstanceFinder) : ElsaEndpoint<AlterationWorkflowInstanceFilter, Res
 13{
 14    /// <inheritdoc />
 15    public override void Configure()
 16    {
 117        Post("/alterations/dry-run");
 118        ConfigurePermissions("run:alterations");
 119    }
 20
 21    /// <inheritdoc />
 22    public override async Task HandleAsync(AlterationWorkflowInstanceFilter filter, CancellationToken cancellationToken)
 23    {
 024        var workflowInstanceIds = await workflowInstanceFinder.FindAsync(filter, cancellationToken);
 025        var response = new Response(workflowInstanceIds.ToList());
 026        await Send.OkAsync(response, cancellationToken);
 027    }
 28}