25 lines
606 B
C#
25 lines
606 B
C#
using TermRemoteCtl.Agent.Configuration;
|
|
|
|
namespace TermRemoteCtl.Agent.Tests.Configuration;
|
|
|
|
public class AgentOptionsValidatorTests
|
|
{
|
|
[Fact]
|
|
public void Validate_Fails_When_DataRoot_Is_Missing()
|
|
{
|
|
var options = new AgentOptions
|
|
{
|
|
DataRoot = "",
|
|
BindAddress = "0.0.0.0",
|
|
HttpsPort = 9443
|
|
};
|
|
|
|
var validator = new AgentOptionsValidator();
|
|
|
|
var result = validator.Validate("Agent", options);
|
|
|
|
Assert.True(result.Failed);
|
|
Assert.Contains(result.Failures, failure => failure.Contains("DataRoot"));
|
|
}
|
|
}
|