< Summary

Information
Class: Elsa.Http.Abstractions.HttpWorkflowInstanceIdSelectorBase
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Abstractions/HttpWorkflowInstanceIdSelectorBase.cs
Line coverage
80%
Covered lines: 4
Uncovered lines: 1
Coverable lines: 5
Total lines: 28
Line coverage: 80%
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
get_Priority()100%11100%
GetWorkflowInstanceIdAsync(...)100%11100%
GetWorkflowInstanceId(...)100%210%
Elsa.Http.IHttpWorkflowInstanceIdSelector.GetWorkflowInstanceIdAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Abstractions/HttpWorkflowInstanceIdSelectorBase.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Http;
 2
 3namespace Elsa.Http.Abstractions;
 4
 5/// <summary>
 6/// Provides a base class for implementing <see cref="IHttpCorrelationIdSelector"/>.
 7/// </summary>
 8public abstract class HttpWorkflowInstanceIdSelectorBase : IHttpWorkflowInstanceIdSelector
 9{
 10    /// <inheritdoc />
 43011    public virtual double Priority => 0;
 12
 13    /// <summary>
 14    /// Override this method to return the workflow instance ID for the specified HTTP context, or <c>null</c> if no wor
 15    /// </summary>
 16    protected virtual ValueTask<string?> GetWorkflowInstanceIdAsync(HttpContext httpContext, CancellationToken cancellat
 17    {
 43018        var workflowInstanceId = GetWorkflowInstanceId(httpContext);
 43019        return new(workflowInstanceId);
 20    }
 21
 22    /// <summary>
 23    /// Override this method to return the workflow instance ID for the specified HTTP context, or <c>null</c> if no wor
 24    /// </summary>
 025    protected virtual string? GetWorkflowInstanceId(HttpContext httpContext) => null;
 26
 43027    ValueTask<string?> IHttpWorkflowInstanceIdSelector.GetWorkflowInstanceIdAsync(HttpContext httpContext, CancellationT
 28}