|
|
@ -39,6 +39,7 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
|
|
|
|
_parsedEpisodeInfo = new ParsedEpisodeInfo
|
|
|
|
_parsedEpisodeInfo = new ParsedEpisodeInfo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SeriesTitle = _series.Title,
|
|
|
|
SeriesTitle = _series.Title,
|
|
|
|
|
|
|
|
SeriesTitleInfo = new SeriesTitleInfo(),
|
|
|
|
SeasonNumber = 1,
|
|
|
|
SeasonNumber = 1,
|
|
|
|
EpisodeNumbers = new[] { 1 }
|
|
|
|
EpisodeNumbers = new[] { 1 }
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -150,6 +151,28 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
|
|
|
|
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Once());
|
|
|
|
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Once());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
public void should_FindByTitle_using_year_when_FindByTitle_matching_fails()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GivenParseResultSeriesDoesntMatchSearchCriteria();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_parsedEpisodeInfo.SeriesTitleInfo = new SeriesTitleInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Title = "Series Title 2017",
|
|
|
|
|
|
|
|
TitleWithoutYear = "Series Title",
|
|
|
|
|
|
|
|
Year = 2017
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ISeriesService>()
|
|
|
|
|
|
|
|
.Setup(s => s.FindByTitle(_parsedEpisodeInfo.SeriesTitleInfo.TitleWithoutYear, _parsedEpisodeInfo.SeriesTitleInfo.Year))
|
|
|
|
|
|
|
|
.Returns(_series);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ISeriesService>()
|
|
|
|
|
|
|
|
.Verify(v => v.FindByTitle(It.IsAny<string>(), It.IsAny<int>()), Times.Once());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_FindByTvdbId_when_search_criteria_and_FindByTitle_matching_fails()
|
|
|
|
public void should_FindByTvdbId_when_search_criteria_and_FindByTitle_matching_fails()
|
|
|
|
{
|
|
|
|
{
|
|
|
|