|
|
|
@ -9,7 +9,9 @@ using NzbDrone.Common.Disk;
|
|
|
|
|
using NzbDrone.Common.Http;
|
|
|
|
|
using NzbDrone.Core.Download;
|
|
|
|
|
using NzbDrone.Core.Download.Clients.TorrentBlackhole;
|
|
|
|
|
using NzbDrone.Core.Exceptions;
|
|
|
|
|
using NzbDrone.Core.MediaFiles.TorrentInfo;
|
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
using NzbDrone.Test.Common;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
|
|
|
|
@ -67,6 +69,21 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
|
|
|
|
|
.Returns(1000000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override RemoteEpisode CreateRemoteEpisode()
|
|
|
|
|
{
|
|
|
|
|
var remoteEpisode = base.CreateRemoteEpisode();
|
|
|
|
|
var torrentInfo = new TorrentInfo();
|
|
|
|
|
|
|
|
|
|
torrentInfo.Title = remoteEpisode.Release.Title;
|
|
|
|
|
torrentInfo.DownloadUrl = remoteEpisode.Release.DownloadUrl;
|
|
|
|
|
torrentInfo.DownloadProtocol = remoteEpisode.Release.DownloadProtocol;
|
|
|
|
|
torrentInfo.MagnetUrl = "magnet:?xt=urn:btih:755248817d32b00cc853e633ecdc48e4c21bff15&dn=Series.S05E10.PROPER.HDTV.x264-DEFiNE%5Brartv%5D&tr=http%3A%2F%2Ftracker.trackerfix.com%3A80%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710&tr=udp%3A%2F%2F9.rarbg.to%3A2710";
|
|
|
|
|
|
|
|
|
|
remoteEpisode.Release = torrentInfo;
|
|
|
|
|
|
|
|
|
|
return remoteEpisode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void completed_download_should_have_required_properties()
|
|
|
|
|
{
|
|
|
|
@ -116,6 +133,15 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
|
|
|
|
|
Mocker.GetMock<IHttpClient>().Verify(c => c.DownloadFile(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void Download_should_throw_if_magnet_and_torrent_url_does_not_exist()
|
|
|
|
|
{
|
|
|
|
|
var remoteEpisode = CreateRemoteEpisode();
|
|
|
|
|
remoteEpisode.Release.DownloadUrl = null;
|
|
|
|
|
|
|
|
|
|
Assert.Throws<ReleaseDownloadException>(() => Subject.Download(remoteEpisode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetItems_should_considered_locked_files_queued()
|
|
|
|
|
{
|
|
|
|
|