From 7b6549fcd351d744155a04fab93aa2483854ec46 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 29 Oct 2013 09:51:54 -0700 Subject: [PATCH] Fixed broken FailedDownloadService tests --- .../Download/DownloadServiceFixture.cs | 1 - .../Download/FailedDownloadServiceFixture.cs | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs index 86413bcc4..cb3a0313c 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs @@ -82,7 +82,6 @@ namespace NzbDrone.Core.Test.Download VerifyEventNotPublished(); } - [Test] public void should_not_attempt_download_if_client_isnt_configure() { diff --git a/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs index 969b0443f..170e0a0b9 100644 --- a/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs @@ -4,6 +4,7 @@ using System.Linq; using FizzWare.NBuilder; using Moq; using NUnit.Framework; +using NzbDrone.Core.Configuration; using NzbDrone.Core.Download; using NzbDrone.Core.History; using NzbDrone.Core.Messaging.Events; @@ -34,6 +35,10 @@ namespace NzbDrone.Core.Test.Download Mocker.GetMock() .Setup(c => c.GetDownloadClient()).Returns(Mocker.GetMock().Object); + + Mocker.GetMock() + .SetupGet(s => s.EnableFailedDownloadHandling) + .Returns(true); } private void GivenNoGrabbedHistory() @@ -188,5 +193,17 @@ namespace NzbDrone.Core.Test.Download VerifyFailedDownloads(2); } + + [Test] + public void should_skip_if_enable_failed_download_handling_is_off() + { + Mocker.GetMock() + .SetupGet(s => s.EnableFailedDownloadHandling) + .Returns(false); + + Subject.Execute(new FailedDownloadCommand()); + + VerifyNoFailedDownloads(); + } } }