Add one-command server and client bootstraps
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using SGU.AuthBroker.Options;
|
||||
using Xunit;
|
||||
|
||||
namespace SGU.AuthBroker.Tests;
|
||||
|
||||
public sealed class BrokerOptionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void ValidateAllowsAnEmptyClientAllowListDuringServerBootstrap()
|
||||
{
|
||||
BrokerOptions options = new();
|
||||
|
||||
options.Validate();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ValidateRejectsAnInvalidConfiguredClientThumbprint()
|
||||
{
|
||||
BrokerOptions options = new()
|
||||
{
|
||||
Tls = new TlsOptions
|
||||
{
|
||||
AllowedClientThumbprints = ["not-a-thumbprint"]
|
||||
}
|
||||
};
|
||||
|
||||
InvalidOperationException exception = Assert.Throws<InvalidOperationException>(options.Validate);
|
||||
|
||||
Assert.Contains("thumbprint", exception.Message, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user