fix(config): centralize port wording, harden HostPort/key guards, doc null/singleton semantics, add tests

This commit is contained in:
Joseph Doherty
2026-06-01 09:37:53 -04:00
parent 8145d79dc6
commit 8d91a3021d
6 changed files with 51 additions and 9 deletions
@@ -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()
{