feat(batch18): implement group-b server core helpers
This commit is contained in:
@@ -7,6 +7,29 @@ namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
|
||||
|
||||
public sealed partial class RouteHandlerTests
|
||||
{
|
||||
[Fact]
|
||||
public void NumRemotesInternal_WhenRoutesExist_ReturnsCount()
|
||||
{
|
||||
var (server, err) = NatsServer.NewServer(new ServerOptions());
|
||||
err.ShouldBeNull();
|
||||
server.ShouldNotBeNull();
|
||||
|
||||
var routesField = typeof(NatsServer).GetField("_routes", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
|
||||
routesField.ShouldNotBeNull();
|
||||
routesField!.SetValue(
|
||||
server,
|
||||
new Dictionary<string, List<ClientConnection>>
|
||||
{
|
||||
["one"] = [],
|
||||
["two"] = [],
|
||||
});
|
||||
|
||||
var method = typeof(NatsServer).GetMethod("NumRemotesInternal", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
|
||||
method.ShouldNotBeNull();
|
||||
var count = (int)method!.Invoke(server, null)!;
|
||||
count.ShouldBe(2);
|
||||
}
|
||||
|
||||
[Fact] // T:2854
|
||||
public void RouteCompressionAuto_ShouldSucceed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user