< Summary

Information
Class: Elsa.Tenants.Extensions.ModuleExtensions
Assembly: Elsa.Tenants
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Extensions/ModuleExtensions.cs
Line coverage
33%
Covered lines: 2
Uncovered lines: 4
Coverable lines: 6
Total lines: 46
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
UseTenants(...)100%11100%
UseTenantManagementEndpoints(...)100%210%
UseTenantManagement(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Tenants/Extensions/ModuleExtensions.cs

#LineLine coverage
 1using Elsa.Features.Services;
 2using Elsa.Tenants.Features;
 3using JetBrains.Annotations;
 4
 5// ReSharper disable once CheckNamespace
 6namespace Elsa.Tenants.Extensions;
 7
 8/// <summary>
 9/// Extensions for <see cref="IModule"/> that installs the <see cref="TenantsFeature"/> feature.
 10/// </summary>
 11[UsedImplicitly]
 12public static class ModuleExtensions
 13{
 14    /// <summary>
 15    /// Installs and configures the <see cref="TenantsFeature"/> feature.
 16    /// </summary>
 17    [UsedImplicitly]
 18    public static IModule UseTenants(this IModule module, Action<TenantsFeature>? configure = null)
 19    {
 1420        module.Configure(configure);
 1421        return module;
 22    }
 23
 24    extension(TenantsFeature feature)
 25    {
 26        /// <summary>
 27        /// Installs and configures the <see cref="TenantManagementEndpointsFeature"/> feature.
 28        /// </summary>
 29        [UsedImplicitly]
 30        public TenantsFeature UseTenantManagementEndpoints(Action<TenantManagementEndpointsFeature>? configure = null)
 31        {
 032            feature.Module.Configure(configure);
 033            return feature;
 34        }
 35
 36        /// <summary>
 37        /// Installs and configures the <see cref="TenantManagementFeature"/> feature.
 38        /// </summary>
 39        [UsedImplicitly]
 40        public TenantsFeature UseTenantManagement(Action<TenantManagementFeature>? configure = null)
 41        {
 042            feature.Module.Configure(configure);
 043            return feature;
 44        }
 45    }
 46}