Files
natsdotnet/tests/NATS.Server.Clustering.Tests/Routes/RouteTopologyGossipTests.cs
Joseph Doherty 615752cdc2 refactor: extract NATS.Server.Clustering.Tests project
Move 29 clustering/routing test files from NATS.Server.Tests to a
dedicated NATS.Server.Clustering.Tests project. Update namespaces,
replace private GetFreePort/ReadUntilAsync helpers with TestUtilities
calls, and extract TestServerFactory/ClusterTestServer to TestUtilities
to fix cross-project reference from JetStreamStartupTests.
2026-03-12 15:31:58 -04:00

26 lines
722 B
C#

using Microsoft.Extensions.Logging.Abstractions;
using NATS.Server.Configuration;
using NATS.Server.Routes;
namespace NATS.Server.Clustering.Tests;
public class RouteTopologyGossipTests
{
[Fact]
public void Topology_snapshot_reports_server_and_route_counts()
{
var manager = new RouteManager(
new ClusterOptions { Host = "127.0.0.1", Port = 0 },
new ServerStats(),
"S1",
_ => { },
_ => { },
NullLogger<RouteManager>.Instance);
var snapshot = manager.BuildTopologySnapshot();
snapshot.ServerId.ShouldBe("S1");
snapshot.RouteCount.ShouldBe(0);
snapshot.ConnectedServerIds.ShouldBeEmpty();
}
}