• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

abatar1 / Environment.Setup / 16553790167

27 Jul 2025 05:38PM UTC coverage: 55.085% (+3.6%) from 51.515%
16553790167

push

github

abatar1
refactor: replace EnvironmentVariableProvider with IEnvironmentReader for improved flexibility

8 of 22 branches covered (36.36%)

Branch coverage included in aggregate %.

12 of 32 new or added lines in 7 files covered. (37.5%)

57 of 96 relevant lines covered (59.38%)

1.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Environment.Setup/EnvironmentFileReader.cs
1
using System.IO;
2

3
namespace Environment.Setup;
4

NEW
5
internal sealed class EnvironmentFileReader(string name) : IEnvironmentReader
×
6
{
7
    /// <summary>
8
    /// Retrieves the value of an environment configuration from the specified source.
9
    /// </summary>
10
    /// <returns>The value of the environment configuration.</returns>
11
    /// <exception cref="EnvironmentVariableNullException">Thrown when the environment configuration value is null, empty, or whitespace.</exception>
12
    public string GetValue()
13
    {
NEW
14
        var environmentVariable = File.ReadAllText(name).Trim();
×
NEW
15
        if (string.IsNullOrWhiteSpace(environmentVariable))
×
NEW
16
            throw new EnvironmentVariableNullException($"Failed to load {name} file, ensure it exists");
×
NEW
17
        return environmentVariable;
×
18
    }
19
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc