|
|
@ -85,7 +85,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
result.EpisodeNumbers.Should().HaveCount(1);
|
|
|
|
result.EpisodeNumbers.Should().HaveCount(1);
|
|
|
|
result.SeasonNumber.Should().Be(seasonNumber);
|
|
|
|
result.SeasonNumber.Should().Be(seasonNumber);
|
|
|
|
result.EpisodeNumbers.First().Should().Be(episodeNumber);
|
|
|
|
result.EpisodeNumbers.First().Should().Be(episodeNumber);
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.NormalizeTitle(title));
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.CleanSeriesTitle(title));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase(@"z:\tv shows\battlestar galactica (2003)\Season 3\S03E05 - Collaborators.mkv", 3, 5)]
|
|
|
|
[TestCase(@"z:\tv shows\battlestar galactica (2003)\Season 3\S03E05 - Collaborators.mkv", 3, 5)]
|
|
|
@ -159,7 +159,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
result.SeasonNumber.Should().Be(season);
|
|
|
|
result.SeasonNumber.Should().Be(season);
|
|
|
|
result.EpisodeNumbers.Should().BeEquivalentTo(episodes);
|
|
|
|
result.EpisodeNumbers.Should().BeEquivalentTo(episodes);
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.NormalizeTitle(title));
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.CleanSeriesTitle(title));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -178,7 +178,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
var airDate = new DateTime(year, month, day);
|
|
|
|
var airDate = new DateTime(year, month, day);
|
|
|
|
result.Should().NotBeNull();
|
|
|
|
result.Should().NotBeNull();
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.NormalizeTitle(title));
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.CleanSeriesTitle(title));
|
|
|
|
result.AirDate.Should().Be(airDate);
|
|
|
|
result.AirDate.Should().Be(airDate);
|
|
|
|
result.EpisodeNumbers.Should().BeNull();
|
|
|
|
result.EpisodeNumbers.Should().BeNull();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -232,7 +232,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
result.SeasonNumber.Should().Be(season);
|
|
|
|
result.SeasonNumber.Should().Be(season);
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.NormalizeTitle(title));
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.CleanSeriesTitle(title));
|
|
|
|
result.EpisodeNumbers.Length.Should().Be(0);
|
|
|
|
result.EpisodeNumbers.Length.Should().Be(0);
|
|
|
|
result.FullSeason.Should().BeTrue();
|
|
|
|
result.FullSeason.Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -244,7 +244,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
[TestCase("Parenthood.2010", "parenthood2010")]
|
|
|
|
[TestCase("Parenthood.2010", "parenthood2010")]
|
|
|
|
public void series_name_normalize(string parsedSeriesName, string seriesName)
|
|
|
|
public void series_name_normalize(string parsedSeriesName, string seriesName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = Parser.Parser.NormalizeTitle(parsedSeriesName);
|
|
|
|
var result = Parser.Parser.CleanSeriesTitle(parsedSeriesName);
|
|
|
|
result.Should().Be(seriesName);
|
|
|
|
result.Should().Be(seriesName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -256,7 +256,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
[TestCase("24", "24")]
|
|
|
|
[TestCase("24", "24")]
|
|
|
|
public void Normalize_Title(string dirty, string clean)
|
|
|
|
public void Normalize_Title(string dirty, string clean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = Parser.Parser.NormalizeTitle(dirty);
|
|
|
|
var result = Parser.Parser.CleanSeriesTitle(dirty);
|
|
|
|
result.Should().Be(clean);
|
|
|
|
result.Should().Be(clean);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -284,7 +284,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
foreach (var s in dirtyFormat)
|
|
|
|
foreach (var s in dirtyFormat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dirty = String.Format(s, word);
|
|
|
|
var dirty = String.Format(s, word);
|
|
|
|
Parser.Parser.NormalizeTitle(dirty).Should().Be("wordword");
|
|
|
|
Parser.Parser.CleanSeriesTitle(dirty).Should().Be("wordword");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -310,7 +310,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
foreach (var s in dirtyFormat)
|
|
|
|
foreach (var s in dirtyFormat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dirty = String.Format(s, word);
|
|
|
|
var dirty = String.Format(s, word);
|
|
|
|
Parser.Parser.NormalizeTitle(dirty).Should().Be(("word" + word.ToLower() + "word"));
|
|
|
|
Parser.Parser.CleanSeriesTitle(dirty).Should().Be(("word" + word.ToLower() + "word"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -327,7 +327,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
public void parse_series_name(string postTitle, string title)
|
|
|
|
public void parse_series_name(string postTitle, string title)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = Parser.Parser.ParseSeriesName(postTitle);
|
|
|
|
var result = Parser.Parser.ParseSeriesName(postTitle);
|
|
|
|
result.Should().Be(Parser.Parser.NormalizeTitle(title));
|
|
|
|
result.Should().Be(Parser.Parser.CleanSeriesTitle(title));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TestCase("Castle.2009.S01E14.English.HDTV.XviD-LOL", Language.English)]
|
|
|
|
[TestCase("Castle.2009.S01E14.English.HDTV.XviD-LOL", Language.English)]
|
|
|
@ -372,7 +372,7 @@ namespace NzbDrone.Core.Test.ParserTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
var result = Parser.Parser.ParseTitle(postTitle);
|
|
|
|
|
|
|
|
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.NormalizeTitle(seriesName));
|
|
|
|
result.SeriesTitle.Should().Be(Parser.Parser.CleanSeriesTitle(seriesName));
|
|
|
|
result.SeasonNumber.Should().Be(seasonNumber);
|
|
|
|
result.SeasonNumber.Should().Be(seasonNumber);
|
|
|
|
result.FullSeason.Should().BeTrue();
|
|
|
|
result.FullSeason.Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|