Fixed: Don't attempt to fetch a release if the download client is disabled

This commit is contained in:
Qstick
2017-10-29 21:22:58 -04:00
parent bff3a55ff3
commit d3aa032cf5
3 changed files with 27 additions and 1 deletions
@@ -180,7 +180,7 @@ namespace NzbDrone.Core.Test.Download
}
[Test]
public void should_not_attempt_download_if_client_isnt_configure()
public void should_not_attempt_download_if_client_isnt_configured()
{
Assert.Throws<DownloadClientUnavailableException>(() => Subject.DownloadReport(_parseResult));
@@ -188,6 +188,21 @@ namespace NzbDrone.Core.Test.Download
VerifyEventNotPublished<AlbumGrabbedEvent>();
}
[Test]
public void should_not_attempt_download_if_client_is_disabled()
{
WithUsenetClient();
Mocker.GetMock<IDownloadClientStatusService>()
.Setup(v => v.IsDisabled(It.IsAny<int>()))
.Returns(true);
Assert.Throws<DownloadClientUnavailableException>(() => Subject.DownloadReport(_parseResult));
Mocker.GetMock<IDownloadClient>().Verify(c => c.Download(It.IsAny<RemoteAlbum>()), Times.Never());
VerifyEventNotPublished<AlbumGrabbedEvent>();
}
[Test]
public void should_send_download_to_correct_usenet_client()
{