|
|
@ -19,6 +19,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|
|
|
protected TransmissionTorrent _downloading;
|
|
|
|
protected TransmissionTorrent _downloading;
|
|
|
|
protected TransmissionTorrent _failed;
|
|
|
|
protected TransmissionTorrent _failed;
|
|
|
|
protected TransmissionTorrent _completed;
|
|
|
|
protected TransmissionTorrent _completed;
|
|
|
|
|
|
|
|
protected TransmissionTorrent _magnet;
|
|
|
|
protected Dictionary<string, object> _transmissionConfigItems;
|
|
|
|
protected Dictionary<string, object> _transmissionConfigItems;
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
[SetUp]
|
|
|
@ -80,6 +81,17 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|
|
|
DownloadDir = "somepath"
|
|
|
|
DownloadDir = "somepath"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_magnet = new TransmissionTorrent
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
HashString = "HASH",
|
|
|
|
|
|
|
|
IsFinished = false,
|
|
|
|
|
|
|
|
Status = TransmissionTorrentStatus.Downloading,
|
|
|
|
|
|
|
|
Name = _title,
|
|
|
|
|
|
|
|
TotalSize = 0,
|
|
|
|
|
|
|
|
LeftUntilDone = 100,
|
|
|
|
|
|
|
|
DownloadDir = "somepath"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<ITorrentFileInfoReader>()
|
|
|
|
Mocker.GetMock<ITorrentFileInfoReader>()
|
|
|
|
.Setup(s => s.GetHashFromTorrentFile(It.IsAny<byte[]>()))
|
|
|
|
.Setup(s => s.GetHashFromTorrentFile(It.IsAny<byte[]>()))
|
|
|
|
.Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951");
|
|
|
|
.Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951");
|
|
|
@ -171,6 +183,14 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void PrepareClientToReturnMagnetItem()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GivenTorrents(new List<TransmissionTorrent>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_magnet
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void queued_item_should_have_required_properties()
|
|
|
|
public void queued_item_should_have_required_properties()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -203,6 +223,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
|
|
|
|
VerifyCompleted(item);
|
|
|
|
VerifyCompleted(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
public void magnet_download_should_not_return_the_item()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
PrepareClientToReturnMagnetItem();
|
|
|
|
|
|
|
|
Subject.GetItems().Count().Should().Be(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void Download_should_return_unique_id()
|
|
|
|
public void Download_should_return_unique_id()
|
|
|
|
{
|
|
|
|
{
|
|
|
|