fix(config): centralize port wording, harden HostPort/key guards, doc null/singleton semantics, add tests
This commit is contained in:
@@ -30,6 +30,15 @@ public sealed class ConfigPreflightTests
|
||||
Assert.Contains(pf.Failures, f => f.Contains("Node:SiteId"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void When_false_does_not_run_block()
|
||||
{
|
||||
var cfg = Config(new() { ["Node:Role"] = "Central" });
|
||||
var pf = ConfigPreflight.For(cfg)
|
||||
.When(cfg["Node:Role"] == "Site", p => p.RequireValue("Node:SiteId"));
|
||||
Assert.True(pf.IsValid); // block skipped, no failure recorded
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ThrowIfInvalid_throws_aggregated_message()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user