mirror of https://github.com/lidarr/Lidarr
Merge branch 'markus101'
This commit is contained in:
commit
3bafd2237f
|
@ -23,9 +23,11 @@ namespace NzbDrone.Core.Test
|
||||||
var parseResult = Builder<EpisodeParseResult>.CreateNew()
|
var parseResult = Builder<EpisodeParseResult>.CreateNew()
|
||||||
.With(c => c.Quality = new Quality(QualityTypes.DVD, false))
|
.With(c => c.Quality = new Quality(QualityTypes.DVD, false))
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
var episodes = Builder<Episode>.CreateListOfSize(2)
|
var episodes = Builder<Episode>.CreateListOfSize(2)
|
||||||
.WhereTheFirst(1).Has(s => s.EpisodeId = 12)
|
.WhereTheFirst(1).Has(s => s.EpisodeId = 12)
|
||||||
.AndTheNext(1).Has(s => s.EpisodeId = 99)
|
.AndTheNext(1).Has(s => s.EpisodeId = 99)
|
||||||
|
.WhereAll().Has(s => s.SeriesId = 5)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,16 +45,15 @@ namespace NzbDrone.Core.Test
|
||||||
.Returns(sabTitle);
|
.Returns(sabTitle);
|
||||||
|
|
||||||
mocker.GetMock<HistoryProvider>()
|
mocker.GetMock<HistoryProvider>()
|
||||||
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 12)));
|
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 12 && h.SeriesId == 5)));
|
||||||
mocker.GetMock<HistoryProvider>()
|
mocker.GetMock<HistoryProvider>()
|
||||||
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 99)));
|
.Setup(s => s.Add(It.Is<History>(h => h.EpisodeId == 99 && h.SeriesId == 5)));
|
||||||
|
|
||||||
mocker.GetMock<EpisodeProvider>()
|
mocker.GetMock<EpisodeProvider>()
|
||||||
.Setup(c => c.GetEpisodesByParseResult(It.IsAny<EpisodeParseResult>(), false)).Returns(episodes);
|
.Setup(c => c.GetEpisodesByParseResult(It.IsAny<EpisodeParseResult>(), false)).Returns(episodes);
|
||||||
|
|
||||||
mocker.Resolve<DownloadProvider>().DownloadReport(parseResult);
|
mocker.Resolve<DownloadProvider>().DownloadReport(parseResult);
|
||||||
|
|
||||||
|
|
||||||
mocker.VerifyAllMocks();
|
mocker.VerifyAllMocks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ namespace NzbDrone.Core.Providers
|
||||||
history.Quality = parseResult.Quality.QualityType;
|
history.Quality = parseResult.Quality.QualityType;
|
||||||
history.NzbTitle = parseResult.NzbTitle;
|
history.NzbTitle = parseResult.NzbTitle;
|
||||||
history.EpisodeId = episode.EpisodeId;
|
history.EpisodeId = episode.EpisodeId;
|
||||||
|
history.SeriesId = episode.SeriesId;
|
||||||
|
|
||||||
_historyProvider.Add(history);
|
_historyProvider.Add(history);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue