Fixed broken tests

(cherry picked from commit 16156192c5f1abd929bcd825186b9f153507a46e)
This commit is contained in:
Mark McDowall 2021-04-21 16:26:11 -07:00 committed by Robin Dadswell
parent efdb9c20d4
commit 7028bfb082
4 changed files with 14 additions and 4 deletions

View File

@ -37,7 +37,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
_magnetFilePath = Path.ChangeExtension(_filePath, ".magnet");
_downloadClientItem = Builder<DownloadClientItem>
.CreateNew().With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.CreateNew()
.With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.With(d => d.OutputPath = new OsPath(Path.Combine(_completedDownloadFolder, _title)))
.Build();
Mocker.SetConstant<IScanWatchFolder>(Mocker.Resolve<ScanWatchFolder>());

View File

@ -32,7 +32,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
_filePath = (@"c:\blackhole\nzb\" + _title + ".nzb").AsOsAgnostic();
_downloadClientItem = Builder<DownloadClientItem>
.CreateNew().With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.CreateNew()
.With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.With(d => d.OutputPath = new OsPath(Path.Combine(_completedDownloadFolder, _title)))
.Build();
Mocker.SetConstant<IScanWatchFolder>(Mocker.Resolve<ScanWatchFolder>());

View File

@ -77,7 +77,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
};
_downloadClientItem = Builder<DownloadClientItem>
.CreateNew().With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.CreateNew()
.With(d => d.DownloadId = "_Droned.S01E01.Pilot.1080p.WEB-DL-DRONE_0")
.With(d => d.OutputPath = new OsPath("/remote/mount/tv/Droned.S01E01.Pilot.1080p.WEB-DL-DRONE".AsOsAgnostic()))
.Build();
Mocker.GetMock<INzbgetProxy>()

View File

@ -102,7 +102,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
};
_downloadClientItem = Builder<DownloadClientItem>
.CreateNew().With(d => d.DownloadId = _completed.Items.First().Id)
.CreateNew()
.With(d => d.Status = DownloadItemStatus.Completed)
.With(d => d.DownloadId = _completed.Items.First().Id)
.Build();
Mocker.GetMock<ISabnzbdProxy>()
@ -588,6 +590,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
public void should_remove_output_path_folder_when_deleting_a_completed_item_and_delete_data_is_true()
{
var path = @"C:\Test\Series.Title.S01E01".AsOsAgnostic();
_downloadClientItem.OutputPath = new OsPath(path);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(path))
@ -611,6 +614,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
public void should_remove_output_path_file_when_deleting_a_completed_item_and_delete_data_is_true()
{
var path = @"C:\Test\Series.Title.S01E01.mkv".AsOsAgnostic();
_downloadClientItem.OutputPath = new OsPath(path);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(path))