|
|
|
@ -27,6 +27,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
|
|
|
|
private List<ImportDecision<LocalTrack>> _approvedDecisions;
|
|
|
|
|
|
|
|
|
|
private DownloadClientItem _downloadClientItem;
|
|
|
|
|
private DownloadClientItemClientInfo _clientInfo;
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
|
public void Setup()
|
|
|
|
@ -79,7 +80,8 @@ namespace NzbDrone.Core.Test.MediaFiles
|
|
|
|
|
.Setup(s => s.UpgradeTrackFile(It.IsAny<TrackFile>(), It.IsAny<LocalTrack>(), It.IsAny<bool>()))
|
|
|
|
|
.Returns(new TrackFileMoveResult());
|
|
|
|
|
|
|
|
|
|
_downloadClientItem = Builder<DownloadClientItem>.CreateNew().Build();
|
|
|
|
|
_clientInfo = Builder<DownloadClientItemClientInfo>.CreateNew().Build();
|
|
|
|
|
_downloadClientItem = Builder<DownloadClientItem>.CreateNew().With(x => x.DownloadClientInfo = _clientInfo).Build();
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IMediaFileService>()
|
|
|
|
|
.Setup(s => s.GetFilesByAlbum(It.IsAny<int>()))
|
|
|
|
@ -187,7 +189,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_copy_when_cannot_move_files_downloads()
|
|
|
|
|
{
|
|
|
|
|
Subject.Import(new List<ImportDecision<LocalTrack>> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false });
|
|
|
|
|
Subject.Import(new List<ImportDecision<LocalTrack>> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false, DownloadClientInfo = _clientInfo });
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IUpgradeMediaFiles>()
|
|
|
|
|
.Verify(v => v.UpgradeTrackFile(It.IsAny<TrackFile>(), _approvedDecisions.First().Item, true), Times.Once());
|
|
|
|
@ -196,7 +198,7 @@ namespace NzbDrone.Core.Test.MediaFiles
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_use_override_importmode()
|
|
|
|
|
{
|
|
|
|
|
Subject.Import(new List<ImportDecision<LocalTrack>> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false }, ImportMode.Move);
|
|
|
|
|
Subject.Import(new List<ImportDecision<LocalTrack>> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false, DownloadClientInfo = _clientInfo }, ImportMode.Move);
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IUpgradeMediaFiles>()
|
|
|
|
|
.Verify(v => v.UpgradeTrackFile(It.IsAny<TrackFile>(), _approvedDecisions.First().Item, false), Times.Once());
|
|
|
|
|