|
|
|
@ -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()
|
|
|
|
|
{
|
|
|
|
|