32 lines
766 B
C#
32 lines
766 B
C#
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);
|
|
}
|
|
}
|