< Summary

Information
Class: Elsa.Extensions.WorkflowsFeatureCommitStateExtensions
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Extensions/ModuleExtensions.cs
Line coverage
33%
Covered lines: 2
Uncovered lines: 4
Coverable lines: 6
Total lines: 49
Line coverage: 33.3%
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
UseCommitStrategies(...)100%11100%
WithDefaultWorkflowCommitStrategy(...)100%210%
WithDefaultActivityCommitStrategy(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/CommitStates/Extensions/ModuleExtensions.cs

#LineLine coverage
 1using Elsa.Workflows.CommitStates;
 2using Elsa.Workflows.Features;
 3
 4// ReSharper disable once CheckNamespace
 5namespace Elsa.Extensions;
 6
 7/// <summary>
 8/// Provides extension methods for configuring commit strategies on <see cref="WorkflowsFeature"/>.
 9/// </summary>
 10public static class WorkflowsFeatureCommitStateExtensions
 11{
 12    /// <summary>
 13    /// Configures commit strategies for workflows.
 14    /// </summary>
 15    /// <param name="workflowsFeature">The workflows feature.</param>
 16    /// <param name="configure">An optional configuration delegate for the commit strategies feature.</param>
 17    /// <returns>The workflows feature for chaining.</returns>
 18    public static WorkflowsFeature UseCommitStrategies(this WorkflowsFeature workflowsFeature, Action<CommitStrategiesFe
 19    {
 720        workflowsFeature.Module.Use(configure);
 721        return workflowsFeature;
 22    }
 23
 24    /// <summary>
 25    /// Sets the specified workflow commit strategy as the global default for all workflows that do not specify their ow
 26    /// The strategy will not be added to the registry and serves only as a fallback.
 27    /// </summary>
 28    /// <param name="workflowsFeature">The workflows feature.</param>
 29    /// <param name="strategy">The workflow commit strategy instance to use as the default.</param>
 30    /// <returns>The workflows feature for chaining.</returns>
 31    public static WorkflowsFeature WithDefaultWorkflowCommitStrategy(this WorkflowsFeature workflowsFeature, IWorkflowCo
 32    {
 033        workflowsFeature.Module.Use<CommitStrategiesFeature>(feature => feature.SetDefaultWorkflowCommitStrategy(strateg
 034        return workflowsFeature;
 35    }
 36
 37    /// <summary>
 38    /// Sets the specified activity commit strategy as the global default for all activities that do not specify their o
 39    /// The strategy will not be added to the registry and serves only as a fallback.
 40    /// </summary>
 41    /// <param name="workflowsFeature">The workflows feature.</param>
 42    /// <param name="strategy">The activity commit strategy instance to use as the default.</param>
 43    /// <returns>The workflows feature for chaining.</returns>
 44    public static WorkflowsFeature WithDefaultActivityCommitStrategy(this WorkflowsFeature workflowsFeature, IActivityCo
 45    {
 046        workflowsFeature.Module.Use<CommitStrategiesFeature>(feature => feature.SetDefaultActivityCommitStrategy(strateg
 047        return workflowsFeature;
 48    }
 49}