feat(historian-client): add TCP/TLS options fields
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Wonderware.Client.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for <see cref="WonderwareHistorianClientOptions"/> TCP/TLS fields.
|
||||
/// </summary>
|
||||
public sealed class WonderwareHistorianClientOptionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void TcpTlsFields_AreStoredCorrectly_WhenExplicitlySet()
|
||||
{
|
||||
var opts = new WonderwareHistorianClientOptions("pipe", "secret")
|
||||
{
|
||||
Host = "h",
|
||||
Port = 32569,
|
||||
UseTls = true,
|
||||
ServerCertThumbprint = "AB"
|
||||
};
|
||||
|
||||
opts.Host.ShouldBe("h");
|
||||
opts.Port.ShouldBe(32569);
|
||||
opts.UseTls.ShouldBeTrue();
|
||||
opts.ServerCertThumbprint.ShouldBe("AB");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TcpTlsFields_HaveCorrectDefaults_WhenNotSet()
|
||||
{
|
||||
var opts = new WonderwareHistorianClientOptions("pipe", "secret");
|
||||
|
||||
opts.Host.ShouldBeNull();
|
||||
opts.Port.ShouldBe(0);
|
||||
opts.UseTls.ShouldBeFalse();
|
||||
opts.ServerCertThumbprint.ShouldBeNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user