< Summary

Information
Class: Syki.Back.Extensions.Env
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Extensions/Env.cs
Tag: 22_11348620282
Line coverage
90%
Covered lines: 9
Uncovered lines: 1
Coverable lines: 10
Total lines: 36
Line coverage: 90%
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
.cctor()100%11100%
SetAsTesting()100%11100%
IsTesting()100%11100%
Get()100%210%
IsDevelopment()100%11100%
GetLastCommitHash()100%11100%

File(s)

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

#LineLine coverage
 1using System.Reflection;
 2
 3namespace Syki.Back.Extensions;
 4
 5public static class Env
 6{
 17    private static string Testing = nameof(Testing);
 18    private static string Development = nameof(Development);
 9
 10    public static void SetAsTesting()
 11    {
 312        Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", Testing);
 313    }
 14
 15    public static bool IsTesting()
 16    {
 27617        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Testing;
 18    }
 19
 20    public static string Get()
 21    {
 022        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")!;
 23    }
 24
 25    public static bool IsDevelopment()
 26    {
 127        return Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Development;
 28    }
 29
 30    public static string GetLastCommitHash()
 31    {
 495832        return typeof(Program).Assembly
 495833            .GetCustomAttribute<AssemblyInformationalVersionAttribute>()
 495834            .InformationalVersion;
 35    }
 36}