Rename 29 ImplBacklog test files from .Impltests.cs to .cs to match PortTracker class names
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Shouldly;
|
||||
using ZB.MOM.NatsNet.Server;
|
||||
using ZB.MOM.NatsNet.Server.Auth;
|
||||
using ZB.MOM.NatsNet.Server.Internal;
|
||||
|
||||
namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
|
||||
|
||||
public sealed class AuthHandlerTests
|
||||
{
|
||||
[Fact] // T:149
|
||||
public void NoAuthUser_ShouldSucceed()
|
||||
{
|
||||
var opts = new ServerOptions
|
||||
{
|
||||
Users = [new User { Username = "alice" }],
|
||||
};
|
||||
|
||||
AuthHandler.ValidateNoAuthUser(opts, "alice").ShouldBeNull();
|
||||
var missingUser = AuthHandler.ValidateNoAuthUser(opts, "bob");
|
||||
missingUser.ShouldNotBeNull();
|
||||
missingUser!.Message.ShouldContain("not present as user or nkey");
|
||||
}
|
||||
|
||||
[Fact] // T:150
|
||||
public void NoAuthUserNkey_ShouldSucceed()
|
||||
{
|
||||
var opts = new ServerOptions
|
||||
{
|
||||
Nkeys = [new NkeyUser { Nkey = "NKEY1" }],
|
||||
};
|
||||
|
||||
AuthHandler.ValidateNoAuthUser(opts, "NKEY1").ShouldBeNull();
|
||||
AuthHandler.ValidateNoAuthUser(opts, "NKEY2").ShouldNotBeNull();
|
||||
}
|
||||
|
||||
[Fact] // T:152
|
||||
public void NoAuthUserNoConnectProto_ShouldSucceed()
|
||||
{
|
||||
var opts = new ServerOptions
|
||||
{
|
||||
Users = [new User { Username = "alice" }],
|
||||
};
|
||||
|
||||
var err = AuthHandler.ValidateNoAuthUser(opts, "bob");
|
||||
err.ShouldNotBeNull();
|
||||
err!.Message.ShouldContain("not present as user or nkey");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user