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

Fixed broken tests.

This commit is contained in:
Mark McDowall 2012-01-14 18:05:05 -08:00
parent b5ddb79c7b
commit 624b6e5acb
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common.AutoMoq;
@ -16,6 +17,11 @@ namespace NzbDrone.Core.Test.JobTests
[TestFixture]
public class BacklogSearchJobTest : CoreTest
{
private void WithEnableBacklogSearching()
{
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
}
[Test]
public void no_missing_epsiodes_should_not_trigger_any_search()
{
@ -25,6 +31,7 @@ public void no_missing_epsiodes_should_not_trigger_any_search()
var episodes = new List<Episode>();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);
@ -49,6 +56,7 @@ public void individual_missing_episode()
var episodes = Builder<Episode>.CreateListOfSize(1).Build();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);
@ -76,6 +84,7 @@ public void individual_missing_episodes_only()
var episodes = Builder<Episode>.CreateListOfSize(5).Build();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);
@ -107,6 +116,7 @@ public void series_season_missing_episodes_only_mismatch_count()
.Build();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);
@ -141,6 +151,7 @@ public void series_season_missing_episodes_only()
.Build();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);
@ -175,6 +186,7 @@ public void multiple_missing_episodes()
.Build();
WithStrictMocker();
WithEnableBacklogSearching();
Mocker.GetMock<EpisodeProvider>()
.Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes);

View File

@ -8,6 +8,7 @@
using NzbDrone.Core.Jobs;
using NzbDrone.Core.Model.Notification;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common.AutoMoq;
@ -17,6 +18,11 @@ namespace NzbDrone.Core.Test.JobTests
[TestFixture]
public class RecentBacklogSearchJobTest : CoreTest
{
private void WithEnableBacklogSearching()
{
Mocker.GetMock<ConfigProvider>().SetupGet(s => s.EnableBacklogSearching).Returns(true);
}
[SetUp]
public void Setup()
{
@ -43,6 +49,8 @@ public void no_missing_epsiodes_should_not_trigger_any_search()
[Test]
public void should_only_process_missing_episodes_from_the_last_30_days()
{
WithEnableBacklogSearching();
//Setup
var episodes = Builder<Episode>.CreateListOfSize(50)
.TheFirst(5)