skip queue check and adding new items if download client isn't configured correctly.

This commit is contained in:
kay.one
2013-07-30 22:49:41 -07:00
parent 1eb278c7f6
commit a5bb99367e
8 changed files with 73 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ using NzbDrone.Core.Download;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.Download
{
@@ -28,9 +29,12 @@ namespace NzbDrone.Core.Test.Download
_parseResult = Builder<RemoteEpisode>.CreateNew()
.With(c => c.Series = Builder<Series>.CreateNew().Build())
.With(c=>c.Report = Builder<ReportInfo>.CreateNew().Build())
.With(c => c.Report = Builder<ReportInfo>.CreateNew().Build())
.With(c => c.Episodes = episodes)
.Build();
Mocker.GetMock<IDownloadClient>().Setup(c => c.IsConfigured).Returns(true);
}
private void WithSuccessfulAdd()
@@ -76,5 +80,20 @@ namespace NzbDrone.Core.Test.Download
Subject.DownloadReport(_parseResult);
VerifyEventNotPublished<EpisodeGrabbedEvent>();
}
[Test]
public void should_not_attempt_download_if_client_isnt_configure()
{
Mocker.GetMock<IDownloadClient>().Setup(c => c.IsConfigured).Returns(false);
Subject.DownloadReport(_parseResult);
Mocker.GetMock<IDownloadClient>().Verify(c => c.DownloadNzb(It.IsAny<RemoteEpisode>()),Times.Never());
VerifyEventNotPublished<EpisodeGrabbedEvent>();
ExceptionVerification.ExpectedWarns(1);
}
}
}