Reformat/cleanup
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s

This commit is contained in:
Joseph Doherty
2026-02-21 07:53:53 -05:00
parent c6f6d9329a
commit 7ebc2cb567
160 changed files with 7258 additions and 7262 deletions

View File

@@ -1,17 +1,16 @@
using System.IO;
using System.Net.Sockets;
using Microsoft.Extensions.Logging.Abstractions;
using ZB.MOM.WW.CBDDC.Core;
using ZB.MOM.WW.CBDDC.Core.Network;
using ZB.MOM.WW.CBDDC.Core.Storage;
using ZB.MOM.WW.CBDDC.Network.Security;
using Microsoft.Extensions.Logging.Abstractions;
namespace ZB.MOM.WW.CBDDC.Network.Tests;
public class HandshakeRegressionTests
{
/// <summary>
/// Verifies that the server invokes the handshake service when a client connects.
/// Verifies that the server invokes the handshake service when a client connects.
/// </summary>
[Fact]
public async Task Server_Should_Call_HandshakeService_On_Client_Connection()
@@ -22,9 +21,11 @@ public class HandshakeRegressionTests
.Returns(new HlcTimestamp(0, 0, "node"));
oplogStore.GetVectorClockAsync(Arg.Any<CancellationToken>())
.Returns(new VectorClock());
oplogStore.GetOplogAfterAsync(Arg.Any<HlcTimestamp>(), Arg.Any<IEnumerable<string>?>(), Arg.Any<CancellationToken>())
oplogStore.GetOplogAfterAsync(Arg.Any<HlcTimestamp>(), Arg.Any<IEnumerable<string>?>(),
Arg.Any<CancellationToken>())
.Returns(Array.Empty<OplogEntry>());
oplogStore.GetOplogForNodeAfterAsync(Arg.Any<string>(), Arg.Any<HlcTimestamp>(), Arg.Any<IEnumerable<string>?>(), Arg.Any<CancellationToken>())
oplogStore.GetOplogForNodeAfterAsync(Arg.Any<string>(), Arg.Any<HlcTimestamp>(),
Arg.Any<IEnumerable<string>?>(), Arg.Any<CancellationToken>())
.Returns(Array.Empty<OplogEntry>());
var configProvider = Substitute.For<IPeerNodeConfigurationProvider>();
@@ -44,7 +45,8 @@ public class HandshakeRegressionTests
authenticator.ValidateAsync(Arg.Any<string>(), Arg.Any<string>()).Returns(true);
var handshakeService = Substitute.For<IPeerHandshakeService>();
handshakeService.HandshakeAsync(Arg.Any<Stream>(), Arg.Any<bool>(), Arg.Any<string>(), Arg.Any<CancellationToken>())
handshakeService.HandshakeAsync(Arg.Any<Stream>(), Arg.Any<bool>(), Arg.Any<string>(),
Arg.Any<CancellationToken>())
.Returns((CipherState?)null);
var server = new TcpSyncServer(
@@ -57,7 +59,7 @@ public class HandshakeRegressionTests
handshakeService);
await server.Start();
var port = server.ListeningPort ?? throw new Exception("Server did not start or report port");
int port = server.ListeningPort ?? throw new Exception("Server did not start or report port");
// Act
using (var client = new TcpClient())
@@ -72,4 +74,4 @@ public class HandshakeRegressionTests
await handshakeService.Received(1)
.HandshakeAsync(Arg.Any<Stream>(), false, "server-node", Arg.Any<CancellationToken>());
}
}
}