< Summary

Information
Class: Elsa.Workflows.Management.Activities.WorkflowDefinitionActivity.WorkflowDefinitionActivityResolver
Assembly: Elsa.Workflows.Management
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivityPortResolver.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 25
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
get_Priority()100%11100%
GetSupportsActivity(...)100%11100%
GetActivityPortsAsync(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Management/Activities/WorkflowDefinitionActivity/WorkflowDefinitionActivityPortResolver.cs

#LineLine coverage
 1using Elsa.Workflows.Models;
 2
 3namespace Elsa.Workflows.Management.Activities.WorkflowDefinitionActivity;
 4
 5/// <summary>
 6/// Returns the root activity for a given <see cref="WorkflowDefinitionActivity"/>.
 7/// </summary>
 8public class WorkflowDefinitionActivityResolver : IActivityResolver
 9{
 10    /// <inheritdoc />
 32411    public int Priority => 0;
 12
 13    /// <inheritdoc />
 1423314    public bool GetSupportsActivity(IActivity activity) => activity is WorkflowDefinitionActivity;
 15
 16    /// <inheritdoc />
 17    public ValueTask<IEnumerable<ActivityPort>> GetActivityPortsAsync(IActivity activity, CancellationToken cancellation
 18    {
 78519        var definitionActivity = (WorkflowDefinitionActivity)activity;
 78520        var root = definitionActivity.Root;
 78521        var port = ActivityPort.FromActivity(root, nameof(WorkflowDefinitionActivity.Root));
 22
 78523        return new([port]);
 24    }
 25}