< Summary - Syki

Information
Class: Syki.Back.Extensions.Env
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Extensions/Env.cs
Tag: 4_16869239191
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 29
Line coverage: 87.5%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
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%
GetEnvironment()0%620%

File(s)

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

#LineLine coverage
 1namespace Syki.Back.Extensions;
 2
 3public static class Env
 4{
 45    private static string Testing = nameof(Testing);
 46    private static string Development = nameof(Development);
 7
 8    public static void SetAsTesting()
 9    {
 810        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", Testing);
 811    }
 12
 13    public static bool IsTesting()
 14    {
 59215        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Testing;
 16    }
 17
 18    public static bool IsDevelopment()
 19    {
 820        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Development;
 21    }
 22
 23    public static string GetEnvironment()
 24    {
 025        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "NOT_FOUND";
 26    }
 27
 428    public static string DeployHash = Guid.NewGuid().ToString()[^8..];
 29}