feat: add system account ($SYS) and server NKey identity stubs
This commit is contained in:
@@ -525,3 +525,25 @@ public class CloseReasonTests : IAsyncLifetime
|
||||
natsClient.CloseReason.ShouldBe(ClosedState.ClientClosed);
|
||||
}
|
||||
}
|
||||
|
||||
public class ServerIdentityTests
|
||||
{
|
||||
[Fact]
|
||||
public void Server_creates_system_account()
|
||||
{
|
||||
var server = new NatsServer(new NatsOptions { Port = 0 }, NullLoggerFactory.Instance);
|
||||
server.SystemAccount.ShouldNotBeNull();
|
||||
server.SystemAccount.Name.ShouldBe("$SYS");
|
||||
server.Dispose();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Server_generates_nkey_identity()
|
||||
{
|
||||
var server = new NatsServer(new NatsOptions { Port = 0 }, NullLoggerFactory.Instance);
|
||||
server.ServerNKey.ShouldNotBeNullOrEmpty();
|
||||
// Server NKey public keys start with 'N'
|
||||
server.ServerNKey[0].ShouldBe('N');
|
||||
server.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user