feat(historian-host): bind TCP host/port/tls config
This commit is contained in:
+20
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user