using NATS.Server.Subscriptions;

namespace NATS.Server.Core.Tests;

public class SubListRemoteFilterTests
{
    [Fact]
    public void Match_remote_filters_by_account_and_subject()
    {
        using var sl = new SubList();
        sl.ApplyRemoteSub(new RemoteSubscription("orders.*", null, "r1", "A"));
        sl.ApplyRemoteSub(new RemoteSubscription("orders.*", null, "r2", "B"));

        var aMatches = sl.MatchRemote("A", "orders.created");
        aMatches.Count.ShouldBe(1);
        aMatches[0].Account.ShouldBe("A");
    }
}
