< Summary

Information
Class: Elsa.Extensions.DependencyInjectionExtensions
Assembly: Elsa.Features
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Features/Extensions/DependencyInjectionExtensions.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 26
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
CreateModule(...)100%11100%
Use(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Features/Extensions/DependencyInjectionExtensions.cs

#LineLine coverage
 1using Elsa.Features.Implementations;
 2using Elsa.Features.Services;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Extensions;
 7
 8/// <summary>
 9/// Adds extension methods to <see cref="IServiceCollection"/> that creates and configures modules.
 10/// </summary>
 11public static class DependencyInjectionExtensions
 12{
 13    /// <summary>
 14    /// Returns a new instance of an <see cref="IModule"/> implementation.
 15    /// </summary>
 116    public static IModule CreateModule(this IServiceCollection services) => new Module(services);
 17
 18    /// <summary>
 19    /// Installs and configures the specified feature. If the feature was already installed, it is not added twice, whic
 20    /// </summary>
 21    public static IModule Use<T>(this IModule module, Action<T>? configure = null) where T: class, IFeature
 22    {
 523        module.Configure(configure);
 524        return module;
 25    }
 26}