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

abatar1 / Environment.Setup / 16710570663

03 Aug 2025 11:24PM UTC coverage: 52.846% (-0.4%) from 53.279%
16710570663

push

github

abatar1
refactor: update EnvironmentFileReader and FromFile method to support separate file name and path parameters

8 of 22 branches covered (36.36%)

Branch coverage included in aggregate %.

0 of 5 new or added lines in 2 files covered. (0.0%)

57 of 101 relevant lines covered (56.44%)

1.55 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, string path) : 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 filePath = Path.Combine(path, name);
×
NEW
15
        var environmentVariable = File.ReadAllText(filePath).Trim();
×
16
        if (string.IsNullOrWhiteSpace(environmentVariable))
×
NEW
17
            throw new EnvironmentVariableNullException($"Failed to load {name} file on path {path}, ensure it exists");
×
18
        return environmentVariable;
×
19
    }
20
}
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