36 lines
796 B
C#
36 lines
796 B
C#
using NATS.Server.Auth;
|
|
using NATS.Server.Subscriptions;
|
|
|
|
namespace NATS.Server.Tests;
|
|
|
|
public class AccountTests
|
|
{
|
|
[Fact]
|
|
public void Account_has_name_and_own_sublist()
|
|
{
|
|
var account = new Account("test-account");
|
|
|
|
account.Name.ShouldBe("test-account");
|
|
account.SubList.ShouldNotBeNull();
|
|
account.SubList.Count.ShouldBe(0u);
|
|
}
|
|
|
|
[Fact]
|
|
public void Account_tracks_clients()
|
|
{
|
|
var account = new Account("test");
|
|
|
|
account.ClientCount.ShouldBe(0);
|
|
account.AddClient(1);
|
|
account.ClientCount.ShouldBe(1);
|
|
account.RemoveClient(1);
|
|
account.ClientCount.ShouldBe(0);
|
|
}
|
|
|
|
[Fact]
|
|
public void GlobalAccount_has_default_name()
|
|
{
|
|
Account.GlobalAccountName.ShouldBe("$G");
|
|
}
|
|
}
|