refactor: extract NATS.Server.Gateways.Tests project

Move 25 gateway-related test files from NATS.Server.Tests into a
dedicated NATS.Server.Gateways.Tests project. Update namespaces,
replace private ReadUntilAsync with SocketTestHelper from TestUtilities,
inline TestServerFactory usage, add InternalsVisibleTo, and register
the project in the solution file. All 261 tests pass.
This commit is contained in:
Joseph Doherty
2026-03-12 15:10:50 -04:00
parent a6be5e11ed
commit 9972b74bc3
29 changed files with 101 additions and 58 deletions

View File

@@ -0,0 +1,20 @@
using NATS.Server.Gateways;
namespace NATS.Server.Gateways.Tests;
public class GatewayAdvancedSemanticsTests
{
[Fact]
public void Gateway_forwarding_remaps_reply_subject_with_gr_prefix_and_restores_on_return()
{
const string originalReply = "_INBOX.123";
const string clusterId = "CLUSTER-A";
var mapped = ReplyMapper.ToGatewayReply(originalReply, clusterId);
mapped.ShouldStartWith("_GR_.");
mapped.ShouldContain(clusterId);
ReplyMapper.TryRestoreGatewayReply(mapped, out var restored).ShouldBeTrue();
restored.ShouldBe(originalReply);
}
}