< Summary

Information
Class: Elsa.Workflows.Features.FlowchartFeature
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Features/FlowchartFeature.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 41
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_FlowchartOptionsConfigurator()100%11100%
Apply()100%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Features/FlowchartFeature.cs

#LineLine coverage
 1using Elsa.Extensions;
 2using Elsa.Features.Abstractions;
 3using Elsa.Features.Services;
 4using Elsa.Workflows.Activities.Flowchart.Models;
 5using Elsa.Workflows.Activities.Flowchart.Options;
 6using Elsa.Workflows.Activities.Flowchart.Serialization;
 7using Elsa.Workflows.Options;
 8using Microsoft.Extensions.DependencyInjection;
 9using Elsa.Common.Serialization;
 10
 11namespace Elsa.Workflows.Features;
 12
 13/// <summary>
 14/// Adds support for the Flowchart activity.
 15/// </summary>
 16public class FlowchartFeature : FeatureBase
 17{
 18    /// <inheritdoc />
 12619    public FlowchartFeature(IModule module) : base(module)
 20    {
 12621    }
 22
 23    /// <summary>
 24    /// A delegate to configure <see cref="FlowchartOptions"/>.
 25    /// </summary>
 13226    public Action<FlowchartOptions>? FlowchartOptionsConfigurator { get; set; }
 27
 28    /// <inheritdoc />
 29    public override void Apply()
 30    {
 12631        Services.AddSerializationOptionsConfigurator<FlowchartSerializationOptionConfigurator>();
 32
 33        // Register FlowchartOptions
 12634        Services.AddOptions<FlowchartOptions>();
 35
 12636        if (FlowchartOptionsConfigurator != null)
 337            Services.Configure(FlowchartOptionsConfigurator);
 38
 25239        Services.Configure<SerializationTypeOptions>(options => options.AddTypeAlias<FlowScope>("FlowScope"));
 12640    }
 41}