37 lines
1017 B
C#
37 lines
1017 B
C#
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("h", 32569, "secret")
|
|
{
|
|
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("host", 32569, "secret");
|
|
|
|
opts.Host.ShouldBe("host");
|
|
opts.Port.ShouldBe(32569);
|
|
opts.UseTls.ShouldBeFalse();
|
|
opts.ServerCertThumbprint.ShouldBeNull();
|
|
}
|
|
}
|