Files
natsdotnet/tests/NATS.Server.Core.Tests/SubList/SubListNotificationTests.cs
Joseph Doherty 7fbffffd05 refactor: rename remaining tests to NATS.Server.Core.Tests
- Rename tests/NATS.Server.Tests -> tests/NATS.Server.Core.Tests
- Update solution file, InternalsVisibleTo, and csproj references
- Remove JETSTREAM_INTEGRATION_MATRIX and NATS.NKeys from csproj (moved to JetStream.Tests and Auth.Tests)
- Update all namespaces from NATS.Server.Tests.* to NATS.Server.Core.Tests.*
- Replace private GetFreePort/ReadUntilAsync helpers with TestUtilities calls
- Fix stale namespace in Transport.Tests/NetworkingGoParityTests.cs
2026-03-12 16:14:02 -04:00

25 lines
846 B
C#

using NATS.Server.Subscriptions;
namespace NATS.Server.Core.Tests;
public class SubListNotificationTests
{
[Fact]
public void Interest_change_notifications_are_emitted_for_local_and_remote_changes()
{
using var sl = new SubList();
var changes = new List<InterestChange>();
sl.InterestChanged += changes.Add;
var sub = new Subscription { Subject = "orders.created", Sid = "1" };
sl.Insert(sub);
sl.Remove(sub);
sl.ApplyRemoteSub(new RemoteSubscription("orders.*", null, "r1", "A"));
sl.ApplyRemoteSub(RemoteSubscription.Removal("orders.*", null, "r1", "A"));
changes.Count.ShouldBe(4);
changes.Select(c => c.Kind).ShouldContain(InterestChangeKind.LocalAdded);
changes.Select(c => c.Kind).ShouldContain(InterestChangeKind.RemoteAdded);
}
}