1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-23 22:25:56 -04:00

Update parser tests to be generic

This commit is contained in:
bakerboy448
2021-02-07 14:06:41 -06:00
committed by GitHub
parent 044cb563a6
commit ae63373b2b
22 changed files with 756 additions and 773 deletions
@@ -8,24 +8,24 @@ namespace NzbDrone.Core.Test.ParserTests
[TestFixture]
public class SeasonParserFixture : CoreTest
{
[TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30 Rock", 4)]
[TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks and Recreation", 2)]
[TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The Office US", 3)]
[TestCase(@"Sons.of.Anarchy.S03.720p.BluRay-CLUE\REWARD", "Sons of Anarchy", 3)]
[TestCase("Adventure Time S02 720p HDTV x264 CRON", "Adventure Time", 2)]
[TestCase("Sealab.2021.S04.iNTERNAL.DVDRip.XviD-VCDVaULT", "Sealab 2021", 4)]
[TestCase("Hawaii Five 0 S01 720p WEB DL DD5 1 H 264 NT", "Hawaii Five 0", 1)]
[TestCase("30 Rock S03 WS PDTV XviD FUtV", "30 Rock", 3)]
[TestCase("The Office Season 4 WS PDTV XviD FUtV", "The Office", 4)]
[TestCase("Eureka Season 1 720p WEB DL DD 5 1 h264 TjHD", "Eureka", 1)]
[TestCase("The Office Season4 WS PDTV XviD FUtV", "The Office", 4)]
[TestCase("Eureka S 01 720p WEB DL DD 5 1 h264 TjHD", "Eureka", 1)]
[TestCase("Doctor Who Confidential Season 3", "Doctor Who Confidential", 3)]
[TestCase("Fleming.S01.720p.WEBDL.DD5.1.H.264-NTb", "Fleming", 1)]
[TestCase("Holmes.Makes.It.Right.S02.720p.HDTV.AAC5.1.x265-NOGRP", "Holmes Makes It Right", 2)]
[TestCase("30.Series.Season.04.HDTV.XviD-DIMENSION", "30 Series", 4)]
[TestCase("Sonarr.and.Series.S02.720p.x264-DIMENSION", "Sonarr and Series", 2)]
[TestCase("The.Series.US.S03.720p.x264-DIMENSION", "The Series US", 3)]
[TestCase(@"Series.of.Sonarr.S03.720p.BluRay-CLUE\REWARD", "Series of Sonarr", 3)]
[TestCase("Series Time S02 720p HDTV x264 CRON", "Series Time", 2)]
[TestCase("Series.2021.S04.iNTERNAL.DVDRip.XviD-VCDVaULT", "Series 2021", 4)]
[TestCase("Series Five 0 S01 720p WEB DL DD5 1 H 264 NT", "Series Five 0", 1)]
[TestCase("30 Series S03 WS PDTV XviD FUtV", "30 Series", 3)]
[TestCase("The Series Season 4 WS PDTV XviD FUtV", "The Series", 4)]
[TestCase("Series Season 1 720p WEB DL DD 5 1 h264 TjHD", "Series", 1)]
[TestCase("The Series Season4 WS PDTV XviD FUtV", "The Series", 4)]
[TestCase("Series S 01 720p WEB DL DD 5 1 h264 TjHD", "Series", 1)]
[TestCase("Series Confidential Season 3", "Series Confidential", 3)]
[TestCase("Series.S01.720p.WEBDL.DD5.1.H.264-NTb", "Series", 1)]
[TestCase("Series.Makes.It.Right.S02.720p.HDTV.AAC5.1.x265-NOGRP", "Series Makes It Right", 2)]
[TestCase("My.Series.S2014.720p.HDTV.x264-ME", "My Series", 2014)]
[TestCase("Velvet.Saison3.VOSTFR.HDTV.XviD-NOTAG", "Velvet", 3)]
[TestCase("Watatatov.SAISON.1.VFQ.PDTV.H264-ACC-ROLLED", "Watatatov", 1)]
[TestCase("Series.Saison3.VOSTFR.HDTV.XviD-NOTAG", "Series", 3)]
[TestCase("Series.SAISON.1.VFQ.PDTV.H264-ACC-ROLLED", "Series", 1)]
public void should_parse_full_season_release(string postTitle, string title, int season)
{
var result = Parser.Parser.ParseTitle(postTitle);
@@ -36,11 +36,11 @@ namespace NzbDrone.Core.Test.ParserTests
result.FullSeason.Should().BeTrue();
}
[TestCase("Acropolis Now S05 EXTRAS DVDRip XviD RUNNER", "Acropolis Now", 5)]
[TestCase("Punky Brewster S01 EXTRAS DVDRip XviD RUNNER", "Punky Brewster", 1)]
[TestCase("Instant Star S03 EXTRAS DVDRip XviD OSiTV", "Instant Star", 3)]
[TestCase("The.Flash.S03.Extras.01.Deleted.Scenes.720p", "The Flash", 3)]
[TestCase("The.Flash.S03.Extras.02.720p", "The Flash", 3)]
[TestCase("Acropolis Series S05 EXTRAS DVDRip XviD RUNNER", "Acropolis Series", 5)]
[TestCase("Punky Series S01 EXTRAS DVDRip XviD RUNNER", "Punky Series", 1)]
[TestCase("Instant Series S03 EXTRAS DVDRip XviD OSiTV", "Instant Series", 3)]
[TestCase("The.Series.S03.Extras.01.Deleted.Scenes.720p", "The Series", 3)]
[TestCase("The.Series.S03.Extras.02.720p", "The Series", 3)]
public void should_parse_season_extras(string postTitle, string title, int season)
{
var result = Parser.Parser.ParseTitle(postTitle);
@@ -52,9 +52,9 @@ namespace NzbDrone.Core.Test.ParserTests
result.IsSeasonExtra.Should().BeTrue();
}
[TestCase("Lie.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD", "Lie to Me", 3)]
[TestCase("The.Middle.S02.SUBPACK.DVDRip.XviD-REWARD", "The Middle", 2)]
[TestCase("CSI.S11.SUBPACK.DVDRip.XviD-REWARD", "CSI", 11)]
[TestCase("Series.to.Me.S03.SUBPACK.DVDRip.XviD-REWARD", "Series to Me", 3)]
[TestCase("The.Series.S02.SUBPACK.DVDRip.XviD-REWARD", "The Series", 2)]
[TestCase("Series.S11.SUBPACK.DVDRip.XviD-REWARD", "Series", 11)]
public void should_parse_season_subpack(string postTitle, string title, int season)
{
var result = Parser.Parser.ParseTitle(postTitle);
@@ -66,7 +66,7 @@ namespace NzbDrone.Core.Test.ParserTests
result.IsSeasonExtra.Should().BeTrue();
}
[TestCase("The.Ranch.2016.S02.Part.1.1080p.NF.WEBRip.DD5.1.x264-NTb", "The Ranch 2016", 2, 1)]
[TestCase("The.Series.2016.S02.Part.1.1080p.NF.WEBRip.DD5.1.x264-NTb", "The Series 2016", 2, 1)]
public void should_parse_partial_season_release(string postTitle, string title, int season, int seasonPart)
{
var result = Parser.Parser.ParseTitle(postTitle);
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Test.ParserTests
result.SeasonPart.Should().Be(seasonPart);
}
[TestCase("The Wire S01-05 WS BDRip X264-REWARD-No Rars", "The Wire", 1)]
[TestCase("The Series S01-05 WS BDRip X264-REWARD-No Rars", "The Series", 1)]
[TestCase("Seinfault.S01-S09.1080p.AMZN.WEB-DL.DDP2.0.H.264-NTb", "Seinfault", 1)]
public void should_parse_multi_season_release(string postTitle, string title, int firstSeason)
{