< Summary

Information
Class: Elsa.KeyValues.Features.KeyValueFeature
Assembly: Elsa.KeyValues
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.KeyValues/Features/KeyValueFeature.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 30
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
.ctor(...)100%11100%
get_KeyValueStore()100%11100%
Apply()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.KeyValues/Features/KeyValueFeature.cs

#LineLine coverage
 1using Elsa.Features.Abstractions;
 2using Elsa.Features.Services;
 3using Elsa.KeyValues.Contracts;
 4using Elsa.KeyValues.Stores;
 5using Microsoft.Extensions.DependencyInjection;
 6
 7namespace Elsa.KeyValues.Features;
 8
 9/// <summary>
 10/// Installs and configures instance management features.
 11/// </summary>
 12public class KeyValueFeature : FeatureBase
 13{
 14    /// <inheritdoc />
 115    public KeyValueFeature(IModule module) : base(module)
 16    {
 117    }
 18
 19    /// <summary>
 20    /// A factory that instantiates an <see cref="IKeyValueStore"/>.
 21    /// </summary>
 322    public Func<IServiceProvider, IKeyValueStore> KeyValueStore { get; set; } = sp => ActivatorUtilities.CreateInstance<
 23
 24
 25    /// <inheritdoc />
 26    public override void Apply()
 27    {
 128        Services.AddScoped(KeyValueStore);
 129    }
 30}