From 92f73900ef03ae5e6ceb1c19e2a294c85cef959a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 26 Sep 2014 07:19:45 -0700 Subject: [PATCH] Moved mini series parsing tests to their own fixture --- .../NzbDrone.Core.Test.csproj | 1 + .../MiniSeriesEpisodeParserFixture.cs | 31 +++++++++++++++++++ .../ParserTests/SingleEpisodeParserFixture.cs | 3 -- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index ed90a2e7a..d62c68769 100644 --- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -197,6 +197,7 @@ + diff --git a/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs new file mode 100644 index 000000000..16d299f4a --- /dev/null +++ b/src/NzbDrone.Core.Test/ParserTests/MiniSeriesEpisodeParserFixture.cs @@ -0,0 +1,31 @@ +using System; +using System.Linq; +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Parser; +using NzbDrone.Core.Test.Framework; + +namespace NzbDrone.Core.Test.ParserTests +{ + + [TestFixture] + public class MiniSeriesEpisodeParserFixture : CoreTest + { + [TestCase("The.Kennedys.Part.2.DSR.XviD-SYS", "The Kennedys", 2)] + [TestCase("the-pacific-e07-720p", "The Pacific", 7)] + [TestCase("Hatfields and McCoys 2012 Part 1 REPACK 720p HDTV x264 2HD", "Hatfields and McCoys 2012", 1)] +// [TestCase("Band.Of.Brothers.EP02.Day.Of.Days.DVDRiP.XviD-DEiTY", "Band.Of.Brothers", 2)] +// [TestCase("", "", 0, 0)] + public void should_parse_mini_series_episode(String postTitle, String title, Int32 episodeNumber) + { + var result = Parser.Parser.ParseTitle(postTitle); + result.Should().NotBeNull(); + result.EpisodeNumbers.Should().HaveCount(1); + result.SeasonNumber.Should().Be(1); + result.EpisodeNumbers.First().Should().Be(episodeNumber); + result.SeriesTitle.Should().Be(title.CleanSeriesTitle()); + result.AbsoluteEpisodeNumbers.Should().BeEmpty(); + result.FullSeason.Should().BeFalse(); + } + } +} diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index c139bd240..34187830e 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -43,8 +43,6 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("24 7 Flyers Rangers Road to the NHL Winter Classic Part01 720p HDTV x264 ORENJI", "24 7 Flyers Rangers Road to the NHL Winter Classic", 1, 1)] [TestCase("24 7 Flyers Rangers Road to the NHL Winter Classic Part 02 720p HDTV x264 ORENJI", "24 7 Flyers Rangers Road to the NHL Winter Classic", 1, 2)] [TestCase("24-7 Flyers-Rangers- Road to the NHL Winter Classic - S01E01 - Part 1", "24 7 Flyers Rangers Road to the NHL Winter Classic", 1, 1)] - [TestCase("The.Kennedys.Part.2.DSR.XviD-SYS", "The Kennedys", 1, 2)] - [TestCase("the-pacific-e07-720p", "The Pacific", 1, 7)] [TestCase("S6E02-Unwrapped-(Playing With Food) - [DarkData]", "", 6, 2)] [TestCase("S06E03-Unwrapped-(Number Ones Unwrapped) - [DarkData]", "", 6, 3)] [TestCase("The Mentalist S02E21 18 5 4 720p WEB DL DD5 1 h 264 EbP", "The Mentalist", 2, 21)] @@ -56,7 +54,6 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("American_Dad!_-_7x6_-_The_Scarlett_Getter_[SDTV]", "American Dad!", 7, 6)] [TestCase("Falling_Skies_-_1x1_-_Live_and_Learn_[HDTV-720p]", "Falling Skies", 1, 1)] [TestCase("Top Gear - 07x03 - 2005.11.70", "Top Gear", 7, 3)] - [TestCase("Hatfields and McCoys 2012 Part 1 REPACK 720p HDTV x264 2HD", "Hatfields and McCoys 2012", 1, 1)] [TestCase("Glee.S04E09.Swan.Song.1080p.WEB-DL.DD5.1.H.264-ECI", "Glee", 4, 9)] [TestCase("S08E20 50-50 Carla [DVD]", "", 8, 20)] [TestCase("Cheers S08E20 50-50 Carla [DVD]", "Cheers", 8, 20)]