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
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user