|
|
|
@ -94,7 +94,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<SabProvider>().GetQueue();
|
|
|
|
|
|
|
|
|
|
result.Should().HaveCount(4);
|
|
|
|
|
result.Should().HaveCount(6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
@ -117,10 +117,47 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
|
|
|
|
|
result.Should().BeTrue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase(2, new[] { 5 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same Series, Diffrent Season, Episode")]
|
|
|
|
|
[TestCase(1, new[] { 6 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same series, diffrent episodes")]
|
|
|
|
|
[TestCase(1, new[] { 6, 7, 8 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same series, diffrent episodes")]
|
|
|
|
|
[TestCase(1, new[] { 6 }, "Some other show", QualityTypes.Bluray1080p, true, Description = "Diffrent series, same season, episdoe")]
|
|
|
|
|
[Test]
|
|
|
|
|
public void is_in_queue_should_find_if_exact_daily_episode_is_in_queue()
|
|
|
|
|
{
|
|
|
|
|
WithFullQueue();
|
|
|
|
|
|
|
|
|
|
var parseResult = new EpisodeParseResult
|
|
|
|
|
{
|
|
|
|
|
Quality = new Quality { QualityType = QualityTypes.Bluray720p, Proper = false },
|
|
|
|
|
AirDate = new DateTime(2011, 12, 01),
|
|
|
|
|
Series = new Series { Title = "The Dailyshow", CleanTitle = Parser.NormalizeTitle("The Dailyshow"), IsDaily = true },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<SabProvider>().IsInQueue(parseResult);
|
|
|
|
|
|
|
|
|
|
result.Should().BeTrue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void is_in_queue_should_find_if_exact_full_season_release_is_in_queue()
|
|
|
|
|
{
|
|
|
|
|
WithFullQueue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var parseResult = new EpisodeParseResult
|
|
|
|
|
{
|
|
|
|
|
Quality = new Quality { QualityType = QualityTypes.Bluray720p, Proper = false },
|
|
|
|
|
FullSeason = true,
|
|
|
|
|
SeasonNumber = 5,
|
|
|
|
|
Series = new Series { Title = "My Name is earl", CleanTitle = Parser.NormalizeTitle("My Name is earl") },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<SabProvider>().IsInQueue(parseResult);
|
|
|
|
|
|
|
|
|
|
result.Should().BeTrue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase(2, new[] { 5 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same Series, Different Season, Episode")]
|
|
|
|
|
[TestCase(1, new[] { 6 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same series, different episodes")]
|
|
|
|
|
[TestCase(1, new[] { 6, 7, 8 }, "30 Rock", QualityTypes.Bluray1080p, true, Description = "Same series, different episodes")]
|
|
|
|
|
[TestCase(1, new[] { 6 }, "Some other show", QualityTypes.Bluray1080p, true, Description = "Different series, same season, episode")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "Rock", QualityTypes.Bluray1080p, true, Description = "Similar series, same season, episodes")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 Rock", QualityTypes.Bluray720p, false, Description = "Same series, higher quality")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 Rock", QualityTypes.HDTV, true, Description = "Same series, higher quality")]
|
|
|
|
@ -134,7 +171,7 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
|
|
|
|
|
EpisodeNumbers = new List<int>(episodes),
|
|
|
|
|
SeasonNumber = season,
|
|
|
|
|
Quality = new Quality { QualityType = qualityType, Proper = proper },
|
|
|
|
|
Series = new Series { Title = title },
|
|
|
|
|
Series = new Series { Title = title, CleanTitle = Parser.NormalizeTitle(title) },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<SabProvider>().IsInQueue(parseResult);
|
|
|
|
@ -143,10 +180,10 @@ namespace NzbDrone.Core.Test.ProviderTests.SabProviderTests
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 Rock", QualityTypes.SDTV, false, Description = "Same Series, lower quality")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 rocK", QualityTypes.SDTV, false, Description = "Same Series, diffrent casing")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 rocK", QualityTypes.SDTV, false, Description = "Same Series, different casing")]
|
|
|
|
|
[TestCase(1, new[] { 5 }, "30 RocK", QualityTypes.HDTV, false, Description = "Same Series, same quality")]
|
|
|
|
|
[TestCase(1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false, Description = "Same Series, same quality, one diffrent episode")]
|
|
|
|
|
[TestCase(1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false, Description = "Same Series, same quality, one diffrent episode")]
|
|
|
|
|
[TestCase(1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false, Description = "Same Series, same quality, one different episode")]
|
|
|
|
|
[TestCase(1, new[] { 5, 6 }, "30 RocK", QualityTypes.HDTV, false, Description = "Same Series, same quality, one different episode")]
|
|
|
|
|
[TestCase(4, new[] { 8 }, "Parks and Recreation", QualityTypes.WEBDL, false, Description = "Same Series, same quality")]
|
|
|
|
|
public void IsInQueue_should_find_same_or_lower_quality_episode_queue(int season, int[] episodes, string title, QualityTypes qualityType, bool proper)
|
|
|
|
|
{
|
|
|
|
|