From d822523394d6f743aa0cdc9b164fb280f431a2d1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 21 Apr 2021 16:26:11 -0700 Subject: [PATCH] Fixed broken tests (cherry picked from commit 16156192c5f1abd929bcd825186b9f153507a46e) --- .../Blackhole/TorrentBlackholeFixture.cs | 4 +++- .../Blackhole/UsenetBlackholeFixture.cs | 4 +++- .../DownloadClientTests/NzbgetTests/NzbgetFixture.cs | 4 +++- .../DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs | 7 ++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs index 5c364cee7..2844229b2 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/TorrentBlackholeFixture.cs @@ -37,7 +37,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole _filePath = (@"c:\blackhole\torrent\" + _title + ".torrent").AsOsAgnostic(); _downloadClientItem = Builder - .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(Mocker.Resolve()); diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs index c0ce7f846..fce3fea4e 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/Blackhole/UsenetBlackholeFixture.cs @@ -33,7 +33,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole _filePath = (@"c:\blackhole\nzb\" + _title + ".nzb").AsOsAgnostic(); _downloadClientItem = Builder - .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(Mocker.Resolve()); diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs index 675067ca3..f430d6b7e 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/NzbgetTests/NzbgetFixture.cs @@ -77,7 +77,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests }; _downloadClientItem = Builder - .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() diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs index 34c6cc966..550579044 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.IO; using FizzWare.NBuilder; using FluentAssertions; using Moq; @@ -103,7 +104,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests }; _downloadClientItem = Builder - .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() @@ -589,6 +592,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() .Setup(s => s.FolderExists(path)) @@ -612,6 +616,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() .Setup(s => s.FolderExists(path))