feat(batch6-task7): port t2 leaf route websocket tls tests

This commit is contained in:
Joseph Doherty
2026-02-28 10:10:27 -05:00
parent 62169c82d9
commit b336fa4519
5 changed files with 282 additions and 4 deletions

View File

@@ -6,6 +6,34 @@ namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
public sealed partial class WebSocketHandlerTests
{
[Fact] // T:3109
public void WSHandshakeTimeout_ShouldSucceed()
{
var options = new ServerOptions();
var errors = new List<Exception>();
var warnings = new List<Exception>();
var parseError = ServerOptions.ParseWebsocket(
new Dictionary<string, object?>
{
["handshake_timeout"] = "1ms",
["tls"] = new Dictionary<string, object?>
{
["verify_and_map"] = true,
},
},
options,
errors,
warnings);
parseError.ShouldBeNull();
errors.ShouldBeEmpty();
options.Websocket.HandshakeTimeout.ShouldBe(TimeSpan.FromMilliseconds(1));
options.Websocket.TlsConfig.ShouldNotBeNull();
options.Websocket.TlsMap.ShouldBeTrue();
options.Websocket.TlsConfig!.ClientCertificateRequired.ShouldBeTrue();
}
[Fact] // T:3105
public void WSPubSub_ShouldSucceed()
{