You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
using AutoMapper;
|
|
using Recyclarr.TrashLib.Config.Parsing;
|
|
using Recyclarr.TrashLib.Config.Services;
|
|
|
|
namespace Recyclarr.TrashLib.Tests.Config.Parsing;
|
|
|
|
[TestFixture]
|
|
[Parallelizable(ParallelScope.All)]
|
|
public class ConfigYamlMapperProfileTest
|
|
{
|
|
private static IMapper CreateMapper()
|
|
{
|
|
return new MapperConfiguration(c => c.AddProfile<ConfigYamlMapperProfile>())
|
|
.CreateMapper();
|
|
}
|
|
|
|
[Test]
|
|
public void Profile_quality_null_substitutions()
|
|
{
|
|
var yaml = new QualityProfileQualityConfigYaml
|
|
{
|
|
Enabled = null
|
|
};
|
|
|
|
var mapper = CreateMapper();
|
|
var result = mapper.Map<QualityProfileQualityConfig>(yaml);
|
|
|
|
result.Enabled.Should().BeTrue();
|
|
}
|
|
|
|
[Test]
|
|
public void Profile_null_substitutions()
|
|
{
|
|
var yaml = new QualityProfileConfigYaml
|
|
{
|
|
QualitySort = null
|
|
};
|
|
|
|
var mapper = CreateMapper();
|
|
var result = mapper.Map<QualityProfileConfig>(yaml);
|
|
|
|
result.QualitySort.Should().Be(QualitySortAlgorithm.Top);
|
|
}
|
|
}
|