From 624b6e5acb299ad1efec8e4009d1b3c118371cab Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 14 Jan 2012 18:05:05 -0800 Subject: [PATCH] Fixed broken tests. --- NzbDrone.Core.Test/JobTests/BacklogSearchJobTest.cs | 12 ++++++++++++ .../JobTests/RecentBacklogSearchJobTest.cs | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/NzbDrone.Core.Test/JobTests/BacklogSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/BacklogSearchJobTest.cs index ab04a8670..dc3e758e8 100644 --- a/NzbDrone.Core.Test/JobTests/BacklogSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/BacklogSearchJobTest.cs @@ -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().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(); WithStrictMocker(); + WithEnableBacklogSearching(); Mocker.GetMock() .Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes); @@ -49,6 +56,7 @@ public void individual_missing_episode() var episodes = Builder.CreateListOfSize(1).Build(); WithStrictMocker(); + WithEnableBacklogSearching(); Mocker.GetMock() .Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes); @@ -76,6 +84,7 @@ public void individual_missing_episodes_only() var episodes = Builder.CreateListOfSize(5).Build(); WithStrictMocker(); + WithEnableBacklogSearching(); Mocker.GetMock() .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() .Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes); @@ -141,6 +151,7 @@ public void series_season_missing_episodes_only() .Build(); WithStrictMocker(); + WithEnableBacklogSearching(); Mocker.GetMock() .Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes); @@ -175,6 +186,7 @@ public void multiple_missing_episodes() .Build(); WithStrictMocker(); + WithEnableBacklogSearching(); Mocker.GetMock() .Setup(s => s.EpisodesWithoutFiles(true)).Returns(episodes); diff --git a/NzbDrone.Core.Test/JobTests/RecentBacklogSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/RecentBacklogSearchJobTest.cs index e9793c021..55f105967 100644 --- a/NzbDrone.Core.Test/JobTests/RecentBacklogSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/RecentBacklogSearchJobTest.cs @@ -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().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.CreateListOfSize(50) .TheFirst(5)