|
|
@ -22,6 +22,7 @@ namespace NzbDrone.Core.Test.Download
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private RemoteEpisode _parseResult;
|
|
|
|
private RemoteEpisode _parseResult;
|
|
|
|
private List<IDownloadClient> _downloadClients;
|
|
|
|
private List<IDownloadClient> _downloadClients;
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
[SetUp]
|
|
|
|
public void Setup()
|
|
|
|
public void Setup()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -180,7 +181,7 @@ namespace NzbDrone.Core.Test.Download
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[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));
|
|
|
|
Assert.Throws<DownloadClientUnavailableException>(() => Subject.DownloadReport(_parseResult));
|
|
|
|
|
|
|
|
|
|
|
@ -188,6 +189,21 @@ namespace NzbDrone.Core.Test.Download
|
|
|
|
VerifyEventNotPublished<EpisodeGrabbedEvent>();
|
|
|
|
VerifyEventNotPublished<EpisodeGrabbedEvent>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[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<RemoteEpisode>()), Times.Never());
|
|
|
|
|
|
|
|
VerifyEventNotPublished<EpisodeGrabbedEvent>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_send_download_to_correct_usenet_client()
|
|
|
|
public void should_send_download_to_correct_usenet_client()
|
|
|
|
{
|
|
|
|
{
|
|
|
|