< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 36
Line coverage: 87.5%
Branch coverage
100%
Covered branches: 4
Total branches: 4
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%44100%
get_SettingName()100%210%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.ViewModels/DTOs/AppSettings/EnvironmentSettings.cs

#LineLine coverage
 1namespace ZhEaIsNsAaBn.ViewModels;
 2
 3/// <summary>Which environment the app runs in. Bind it from the <c>EnvironmentSettings</c> configuration section.</summ
 4public class EnvironmentSettings
 5{
 6    private const string DevelopmentName = "Development";
 7
 8
 9    /// <summary>
 10    /// Creates the settings. <see cref="IsDevelopment"/> starts as <see langword="true"/> when the hosting environment 
 11    /// <c>Development</c>: <c>ASPNETCORE_ENVIRONMENT</c>, or <c>DOTNET_ENVIRONMENT</c> if that isn't set (case-insensit
 12    /// same precedence as ASP.NET Core). Values bound from configuration override it.
 13    /// </summary>
 3614    public EnvironmentSettings()
 15    {
 3616        var environmentName = Environment.GetEnvironmentVariable( "ASPNETCORE_ENVIRONMENT" )
 3617                           ?? Environment.GetEnvironmentVariable( "DOTNET_ENVIRONMENT" );
 18
 19
 3620        if ( string.Equals( environmentName, DevelopmentName, StringComparison.OrdinalIgnoreCase ) )
 21        {
 1222            IsDevelopment = true;
 1223            IsProduction  = false;
 24        }
 3625    }
 26
 27
 28    /// <summary>The configuration section name: <c>EnvironmentSettings</c>.</summary>
 029    public static string SettingName => "EnvironmentSettings";
 30
 31    /// <summary>Whether the app runs in production.</summary>
 32    public bool IsProduction { get; set; }
 33
 34    /// <summary>Whether the app runs in development. Checked before <see cref="IsProduction"/>.</summary>
 35    public bool IsDevelopment { get; set; }
 36}

Methods/Properties

.ctor()
get_SettingName()