mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Fixed a big where Season 0 wasn't being ignored for new seasons + a test to confirm it.
This commit is contained in:
parent
bae2cdc1c7
commit
fbc0a561ca
2 changed files with 45 additions and 4 deletions
|
@ -414,6 +414,46 @@ namespace NzbDrone.Core.Test.ProviderTests
|
|||
result.Where(e => e.EpisodeNumber == 0 && e.SeasonNumber == 15).Single().Ignored.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RefreshEpisodeInfo_ignore_season_zero()
|
||||
{
|
||||
//Arrange
|
||||
const int seriesId = 71663;
|
||||
const int episodeCount = 10;
|
||||
|
||||
var fakeEpisodes = Builder<TvdbSeries>.CreateNew().With(
|
||||
c => c.Episodes =
|
||||
new List<TvdbEpisode>(Builder<TvdbEpisode>.CreateListOfSize(episodeCount).
|
||||
All()
|
||||
.With(l => l.Language = new TvdbLanguage(0, "eng", "a"))
|
||||
.With(e => e.SeasonNumber = 0)
|
||||
.Build())
|
||||
).With(c => c.Id = seriesId).Build();
|
||||
|
||||
var fakeSeries = Builder<Series>.CreateNew().With(c => c.SeriesId = seriesId).Build();
|
||||
|
||||
var mocker = new AutoMoqer();
|
||||
|
||||
var db = TestDbHelper.GetEmptyDatabase();
|
||||
mocker.SetConstant(db);
|
||||
|
||||
db.Insert(fakeSeries);
|
||||
|
||||
mocker.GetMock<TvDbProvider>()
|
||||
.Setup(c => c.GetSeries(seriesId, true))
|
||||
.Returns(fakeEpisodes);
|
||||
|
||||
|
||||
//Act
|
||||
mocker.Resolve<EpisodeProvider>().RefreshEpisodeInfo(fakeSeries);
|
||||
|
||||
//Assert
|
||||
var result = mocker.Resolve<EpisodeProvider>().GetEpisodeBySeries(seriesId).ToList();
|
||||
mocker.GetMock<TvDbProvider>().VerifyAll();
|
||||
result.Should().HaveCount(episodeCount);
|
||||
result.Where(e => e.Ignored).Should().HaveCount(episodeCount);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void new_episodes_only_calls_Insert()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue