refactor: extract NATS.Server.LeafNodes.Tests project
Move 28 leaf node test files from NATS.Server.Tests into a dedicated NATS.Server.LeafNodes.Tests project. Update namespaces, add InternalsVisibleTo, register in solution file. Replace all Task.Delay polling loops with PollHelper.WaitUntilAsync/YieldForAsync from TestUtilities. Replace private ReadUntilAsync in LeafProtocolTests with SocketTestHelper.ReadUntilAsync. All 281 tests pass.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using NATS.Server.LeafNodes;
|
||||
|
||||
namespace NATS.Server.LeafNodes.Tests.LeafNodes;
|
||||
|
||||
public class LeafHubSpokeMappingParityTests
|
||||
{
|
||||
[Fact]
|
||||
public void Leaf_hub_spoke_mapper_round_trips_account_mapping()
|
||||
{
|
||||
var mapper = new LeafHubSpokeMapper(new Dictionary<string, string>
|
||||
{
|
||||
["HUB"] = "SPOKE",
|
||||
});
|
||||
|
||||
var outbound = mapper.Map("HUB", "orders.created", LeafMapDirection.Outbound);
|
||||
outbound.Account.ShouldBe("SPOKE");
|
||||
|
||||
var inbound = mapper.Map("SPOKE", "orders.created", LeafMapDirection.Inbound);
|
||||
inbound.Account.ShouldBe("HUB");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user