1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Added another test.

This commit is contained in:
Mark McDowall 2012-02-21 21:04:48 -08:00
parent aac42d4882
commit 6798cb342a

View File

@ -1100,6 +1100,42 @@ public void IgnoreSeason_Ignore_Half()
Mocker.VerifyAllMocks();
}
[Test]
public void IgnoreSeason_should_call_SetIgnore_in_season_provider_one_time_only()
{
WithRealDb();
var episodes = Builder<Episode>.CreateListOfSize(4)
.All()
.With(c => c.SeriesId = 10)
.With(c => c.SeasonNumber = 1)
.With(c => c.Ignored = false)
.Build().ToList();
var season = new Season
{
SeriesId = 10,
SeasonNumber = 1,
Ignored = false
};
Db.Insert(season);
Db.InsertMany(episodes);
Mocker.GetMock<SeasonProvider>().Setup(s => s.SetIgnore(10, 1, true)).Verifiable();
//Act
Mocker.Resolve<EpisodeProvider>().SetSeasonIgnore(10, 1, true);
//Assert
var episodesInDb = Db.Fetch<Episode>(@"SELECT * FROM Episodes");
episodesInDb.Should().HaveCount(4);
episodesInDb.Where(e => e.Ignored).Should().HaveCount(4);
Mocker.GetMock<SeasonProvider>().Verify(s => s.SetIgnore(10, 1, true), Times.Once());
}
[Test]
public void EpisodesWithoutFiles_no_specials()
{