mirror of
https://github.com/Radarr/Radarr
synced 2024-12-23 16:32:48 +00:00
09665c2920
New: WEBDL 720p and 1080p are now separated
36 lines
No EOL
1.8 KiB
C#
36 lines
No EOL
1.8 KiB
C#
// ReSharper disable RedundantUsingDirective
|
|
|
|
using System.Linq;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.Model;
|
|
using NzbDrone.Core.Providers.DecisionEngine;
|
|
using NzbDrone.Core.Repository.Quality;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test.ProviderTests.DecisionEngineTests
|
|
{
|
|
[TestFixture]
|
|
// ReSharper disable InconsistentNaming
|
|
public class QualityUpgradeSpecificationFixture : CoreTest
|
|
{
|
|
public static object[] IsUpgradeTestCases =
|
|
{
|
|
new object[] { QualityTypes.SDTV, false, QualityTypes.SDTV, true, QualityTypes.SDTV, true },
|
|
new object[] { QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, true, QualityTypes.WEBDL720p, true },
|
|
new object[] { QualityTypes.SDTV, false, QualityTypes.SDTV, false, QualityTypes.SDTV, false },
|
|
new object[] { QualityTypes.SDTV, false, QualityTypes.DVD, true, QualityTypes.SDTV, false },
|
|
new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV, true, QualityTypes.Bluray720p, false },
|
|
new object[] { QualityTypes.WEBDL720p, false, QualityTypes.HDTV, true, QualityTypes.WEBDL720p, false },
|
|
new object[] { QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, false, QualityTypes.WEBDL720p, false },
|
|
new object[] { QualityTypes.SDTV, false, QualityTypes.SDTV, true, QualityTypes.SDTV, true }
|
|
};
|
|
|
|
[Test, TestCaseSource("IsUpgradeTestCases")]
|
|
public void IsUpgradeTest(QualityTypes current, bool currentProper, QualityTypes newQuality, bool newProper, QualityTypes cutoff, bool expected)
|
|
{
|
|
new QualityUpgradeSpecification().IsSatisfiedBy(new QualityModel(current, currentProper), new QualityModel(newQuality, newProper), cutoff)
|
|
.Should().Be(expected);
|
|
}
|
|
}
|
|
} |