Series Grid won't show series that haven't been completely added (LastInfoSync is null).

This commit is contained in:
Mark McDowall 2012-01-22 20:14:01 -08:00
commit baa0b8df67
2 changed files with 37 additions and 0 deletions

View file

@ -317,6 +317,42 @@ namespace NzbDrone.Core.Test.ProviderTests
Assert.AreEqual(5, series[0].EpisodeFileCount);
}
[Test]
public void Get_Series_should_not_return_series_that_do_not_have_info_synced_yet()
{
WithRealDb();
var fakeQuality = Builder<QualityProfile>.CreateNew().Build();
var fakeSeries = Builder<Series>.CreateListOfSize(5)
.All()
.With(e => e.QualityProfileId = fakeQuality.QualityProfileId)
.TheLast(2)
.With(e => e.LastInfoSync = null)
.Build();
var fakeEpisodes = Builder<Episode>.CreateListOfSize(10)
.All()
.With(e => e.SeriesId = fakeSeries.First().SeriesId)
.With(e => e.AirDate = DateTime.Today.AddDays(-1))
.TheFirst(5)
.With(e => e.Ignored = false)
.TheLast(5)
.With(e => e.Ignored = true)
.Build();
Db.InsertMany(fakeSeries);
Db.Insert(fakeQuality);
Db.InsertMany(fakeEpisodes);
//Act
Mocker.Resolve<QualityProvider>();
var series = Mocker.Resolve<SeriesProvider>().GetAllSeriesWithEpisodeCount();
//Assert
series.Should().HaveCount(3);
}
[Test]
public void Get_Single_Series()
{