QualityTypes no longer an enum

This commit is contained in:
Mark McDowall 2012-10-13 17:36:16 -07:00
commit 92acb4c049
37 changed files with 585 additions and 247 deletions

View file

@ -20,6 +20,15 @@ namespace NzbDrone.Core.Test.ProviderTests
[TestFixture]
public class DownloadProviderFixture : CoreTest
{
public static object[] SabNamingCases =
{
new object[] { 1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x02 - My Episode Title [DVD]" },
new object[] { 1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x02 - My Episode Title [DVD] [Proper]" },
new object[] { 1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x02 - [DVD] [Proper]" },
new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, false, "My Series Name - 1x02-1x04 - My Episode Title [HDTV]" },
new object[] { 1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, true, "My Series Name - 1x02-1x04 - My Episode Title [HDTV] [Proper]" },
new object[] { 1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, "My Series Name - 1x02-1x04 - [HDTV] [Proper]" },
};
private void SetDownloadClient(DownloadClientType clientType)
{
@ -68,7 +77,6 @@ namespace NzbDrone.Core.Test.ProviderTests
.Returns(false);
}
[Test]
public void Download_report_should_send_to_sab_add_to_history_mark_as_grabbed()
{
@ -162,8 +170,6 @@ namespace NzbDrone.Core.Test.ProviderTests
.Verify(c => c.OnGrab(It.IsAny<String>()), Times.Never());
}
[Test]
public void should_return_sab_as_active_client()
{
@ -178,14 +184,8 @@ namespace NzbDrone.Core.Test.ProviderTests
Mocker.Resolve<DownloadProvider>().GetActiveDownloadClient().Should().BeAssignableTo<BlackholeProvider>();
}
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, Result = "My Series Name - 1x02 - My Episode Title [DVD]")]
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, Result = "My Series Name - 1x02 - My Episode Title [DVD] [Proper]")]
[TestCase(1, new[] { 2 }, "", QualityTypes.DVD, true, Result = "My Series Name - 1x02 - [DVD] [Proper]")]
[TestCase(1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, false, Result = "My Series Name - 1x02-1x04 - My Episode Title [HDTV]")]
[TestCase(1, new[] { 2, 4 }, "My Episode Title", QualityTypes.HDTV, true, Result = "My Series Name - 1x02-1x04 - My Episode Title [HDTV] [Proper]")]
[TestCase(1, new[] { 2, 4 }, "", QualityTypes.HDTV, true, Result = "My Series Name - 1x02-1x04 - [HDTV] [Proper]")]
public string create_proper_sab_titles(int seasons, int[] episodes, string title, QualityTypes quality, bool proper)
[Test, TestCaseSource("SabNamingCases")]
public void create_proper_sab_titles(int seasons, int[] episodes, string title, QualityTypes quality, bool proper, string expected)
{
var series = Builder<Series>.CreateNew()
.With(c => c.Title = "My Series Name")
@ -201,7 +201,7 @@ namespace NzbDrone.Core.Test.ProviderTests
EpisodeTitle = title
};
return Mocker.Resolve<DownloadProvider>().GetDownloadTitle(parsResult);
Mocker.Resolve<DownloadProvider>().GetDownloadTitle(parsResult).Should().Be(expected);
}
[TestCase(true, Result = "My Series Name - Season 1 [Bluray720p] [Proper]")]