Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/recyclarr/src/commit/e90443c58b832ceca26a7bdc40cd6daf221e4187/tests/Recyclarr.Tests/Config/Parsing/ConfigValidationExecutorTest.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
recyclarr/tests/Recyclarr.Tests/Config/Parsing/ConfigValidationExecutorTes...

52 lines
1.5 KiB

using FluentValidation;
using FluentValidation.Results;
using Recyclarr.Common.FluentValidation;
using Recyclarr.Config.Parsing;
using Recyclarr.Tests.TestLibrary;
namespace Recyclarr.Tests.Config.Parsing;
[TestFixture]
public class ConfigValidationExecutorTest
{
[Test, AutoMockData]
public void Return_false_on_validation_failure(
[Frozen] IRuntimeValidationService validationService,
ConfigValidationExecutor sut)
{
validationService.Validate(default!).ReturnsForAnyArgs(new ValidationResult([
new ValidationFailure("property", "message")
]));
var result = sut.Validate(NewConfig.Radarr());
result.Should().BeFalse();
}
[Test, AutoMockData]
public void Return_true_when_severity_is_warning(
[Frozen] IRuntimeValidationService validationService,
ConfigValidationExecutor sut)
{
validationService.Validate(default!).ReturnsForAnyArgs(new ValidationResult([
new ValidationFailure("property", "message") {Severity = Severity.Warning}
]));
var result = sut.Validate(NewConfig.Radarr());
result.Should().BeTrue();
}
[Test, AutoMockData]
public void Valid_returns_true(
[Frozen] IRuntimeValidationService validationService,
ConfigValidationExecutor sut)
{
validationService.Validate(default!).ReturnsForAnyArgs(new ValidationResult());
var result = sut.Validate(NewConfig.Radarr());
result.Should().BeTrue();
}
}