1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/NzbDrone.Core.Test/DecisionEngineTests/QualityUpgradeSpecificationFixture.cs

39 lines
1.9 KiB
C#
Raw Normal View History

// ReSharper disable RedundantUsingDirective
using System.Linq;
2012-10-14 02:36:16 +02:00
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine.Specifications;
2013-02-27 04:19:22 +01:00
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Model;
2013-02-19 03:19:38 +01:00
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Test.Framework;
2013-02-19 03:19:38 +01:00
namespace NzbDrone.Core.Test.DecisionEngineTests
{
[TestFixture]
// ReSharper disable InconsistentNaming
public class QualityUpgradeSpecificationFixture : CoreTest<QualityUpgradableSpecification>
{
2012-10-14 02:36:16 +02:00
public static object[] IsUpgradeTestCases =
{
2013-02-27 04:19:22 +01:00
new object[] { Quality.SDTV, false, Quality.SDTV, true, Quality.SDTV, true },
new object[] { Quality.WEBDL720p, false, Quality.WEBDL720p, true, Quality.WEBDL720p, true },
new object[] { Quality.SDTV, false, Quality.SDTV, false, Quality.SDTV, false },
new object[] { Quality.SDTV, false, Quality.DVD, true, Quality.SDTV, false },
new object[] { Quality.WEBDL720p, false, Quality.HDTV720p, true, Quality.Bluray720p, false },
new object[] { Quality.WEBDL720p, false, Quality.HDTV720p, true, Quality.WEBDL720p, false },
new object[] { Quality.WEBDL720p, false, Quality.WEBDL720p, false, Quality.WEBDL720p, false },
new object[] { Quality.SDTV, false, Quality.SDTV, true, Quality.SDTV, true },
new object[] { Quality.WEBDL1080p, false, Quality.WEBDL1080p, false, Quality.WEBDL1080p, false }
2012-10-14 02:36:16 +02:00
};
2012-10-14 02:36:16 +02:00
[Test, TestCaseSource("IsUpgradeTestCases")]
2013-02-27 04:19:22 +01:00
public void IsUpgradeTest(Quality current, bool currentProper, Quality newQuality, bool newProper, Quality cutoff, bool expected)
{
Subject.IsUpgradable(new QualityProfile() { Cutoff = cutoff }, new QualityModel(current, currentProper), new QualityModel(newQuality, newProper))
2012-10-14 02:36:16 +02:00
.Should().Be(expected);
}
}
}