feat(historian-host): bind TCP host/port/tls config

This commit is contained in:
Joseph Doherty
2026-06-12 11:19:46 -04:00
parent 3528702185
commit 7ce7505a36
4 changed files with 40 additions and 1 deletions
@@ -169,4 +169,24 @@ public sealed class AlarmHistorianRegistrationTests
warnings.ShouldContain(w => w.Contains("DatabasePath"));
warnings.Count.ShouldBeGreaterThanOrEqualTo(2);
}
[Fact]
public void Section_binds_tcp_host_port_tls_fields()
{
var config = ConfigFrom(new Dictionary<string, string?>
{
["AlarmHistorian:Host"] = "historian.example.com",
["AlarmHistorian:Port"] = "12345",
["AlarmHistorian:UseTls"] = "true",
["AlarmHistorian:ServerCertThumbprint"] = "AABBCCDDEEFF",
});
var opts = config.GetSection(AlarmHistorianOptions.SectionName).Get<AlarmHistorianOptions>();
opts.ShouldNotBeNull();
opts.Host.ShouldBe("historian.example.com");
opts.Port.ShouldBe(12345);
opts.UseTls.ShouldBeTrue();
opts.ServerCertThumbprint.ShouldBe("AABBCCDDEEFF");
}
}