Don't try to process a download client item with an invalid path for the OS

This commit is contained in:
Mark McDowall
2015-10-20 23:34:13 -07:00
parent 330554edb0
commit 04de0049fe
3 changed files with 41 additions and 0 deletions
@@ -381,6 +381,30 @@ namespace NzbDrone.Core.Test.Download
AssertCompletedDownload();
}
[Test]
public void should_warn_if_path_is_not_valid_for_windows()
{
WindowsOnly();
_trackedDownload.DownloadItem.OutputPath = new OsPath(@"/invalid/Windows/Path");
Subject.Process(_trackedDownload);
AssertNoAttemptedImport();
}
[Test]
public void should_warn_if_path_is_not_valid_for_linux()
{
MonoOnly();
_trackedDownload.DownloadItem.OutputPath = new OsPath(@"C:\Invalid\Mono\Path");
Subject.Process(_trackedDownload);
AssertNoAttemptedImport();
}
private void AssertNoAttemptedImport()
{
Mocker.GetMock<IDownloadedEpisodesImportService>()