1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-24 17:01:38 +00:00

History Items are now added with series. Test makes sure seriesId is sent in.

This commit is contained in:
Mark McDowall 2011-06-21 19:15:39 -07:00
parent ecd0fb50a8
commit 8d4f65b7dc
2 changed files with 4 additions and 3 deletions

View file

@ -24,6 +24,7 @@ public void Download_report_should_send_to_sab_and_add_to_history()
.With(e => e.Episodes = Builder<Episode>.CreateListOfSize(2) .With(e => e.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())
.With(c => c.Quality = new Quality(QualityTypes.DVD, false)) .With(c => c.Quality = new Quality(QualityTypes.DVD, false))
.Build(); .Build();
@ -42,13 +43,12 @@ public void Download_report_should_send_to_sab_and_add_to_history()
.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.Resolve<DownloadProvider>().DownloadReport(parseResult); mocker.Resolve<DownloadProvider>().DownloadReport(parseResult);
mocker.VerifyAllMocks(); mocker.VerifyAllMocks();
} }
} }

View file

@ -48,6 +48,7 @@ public virtual bool DownloadReport(EpisodeParseResult parseResult)
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);
} }