< Summary - Syki

Information
Class: Syki.Back.Extensions.EnvironmentExtensions
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Extensions/EnvironmentExtensions.cs
Tag: 56_26538939494
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 29
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
SetAsTesting()100%11100%
IsTesting()100%11100%
IsDevelopment()100%11100%
IsDevelopmentOrTesting()50%22100%

File(s)

/home/runner/work/syki/syki/Back/Extensions/EnvironmentExtensions.cs

#LineLine coverage
 1namespace Syki.Back.Extensions;
 2
 3public static class EnvironmentExtensions
 4{
 45    private static string Testing = nameof(Testing);
 46    private static string Development = nameof(Development);
 7
 8    public static void SetAsTesting()
 9    {
 610        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", Testing);
 611    }
 12
 13    public static bool IsTesting()
 14    {
 415        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Testing;
 16    }
 17
 18    public static bool IsDevelopment()
 19    {
 220        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Development;
 21    }
 22
 23    public static bool IsDevelopmentOrTesting()
 24    {
 225        return IsDevelopment() || IsTesting();
 26    }
 27
 428    public static string DeployHash = Guid.NewGuid().ToString()[^8..];
 29}