|
|
|
@ -11,10 +11,10 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
|
|
|
|
|
public class FilteredProfileDataTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void Filter_IncludeOptional_HasAllOptionalItems()
|
|
|
|
|
public void Filter_ExcludeOptional_HasNoOptionalItems()
|
|
|
|
|
{
|
|
|
|
|
var config = new ReleaseProfileConfig();
|
|
|
|
|
config.Filter.IncludeOptional = true;
|
|
|
|
|
config.Filter.IncludeOptional = false;
|
|
|
|
|
|
|
|
|
|
var profileData = new ProfileData
|
|
|
|
|
{
|
|
|
|
@ -40,21 +40,20 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
|
|
|
|
|
|
|
|
|
|
filtered.Should().BeEquivalentTo(new
|
|
|
|
|
{
|
|
|
|
|
Ignored = new List<string> {"ignored1", "ignored2"},
|
|
|
|
|
Required = new List<string> {"required1", "required2"},
|
|
|
|
|
Ignored = new List<string> {"ignored1"},
|
|
|
|
|
Required = new List<string> {"required1"},
|
|
|
|
|
Preferred = new Dictionary<int, List<string>>
|
|
|
|
|
{
|
|
|
|
|
{100, new List<string> {"preferred1", "preferred3"}},
|
|
|
|
|
{200, new List<string> {"preferred2"}}
|
|
|
|
|
{100, new List<string> {"preferred1"}}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void Filter_ExcludeOptional_HasNoOptionalItems()
|
|
|
|
|
public void Filter_IncludeOptional_HasAllOptionalItems()
|
|
|
|
|
{
|
|
|
|
|
var config = new ReleaseProfileConfig();
|
|
|
|
|
config.Filter.IncludeOptional = false;
|
|
|
|
|
config.Filter.IncludeOptional = true;
|
|
|
|
|
|
|
|
|
|
var profileData = new ProfileData
|
|
|
|
|
{
|
|
|
|
@ -80,11 +79,12 @@ namespace Trash.Tests.Sonarr.ReleaseProfile
|
|
|
|
|
|
|
|
|
|
filtered.Should().BeEquivalentTo(new
|
|
|
|
|
{
|
|
|
|
|
Ignored = new List<string> {"ignored1"},
|
|
|
|
|
Required = new List<string> {"required1"},
|
|
|
|
|
Ignored = new List<string> {"ignored1", "ignored2"},
|
|
|
|
|
Required = new List<string> {"required1", "required2"},
|
|
|
|
|
Preferred = new Dictionary<int, List<string>>
|
|
|
|
|
{
|
|
|
|
|
{100, new List<string> {"preferred1"}}
|
|
|
|
|
{100, new List<string> {"preferred1", "preferred3"}},
|
|
|
|
|
{200, new List<string> {"preferred2"}}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|