mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
More skip import
This commit is contained in:
parent
b5e196fcef
commit
5014745f88
@ -72,10 +72,13 @@ public void ProcessDropFolder_should_only_process_folders_that_arent_known_serie
|
||||
.Setup(c => c.GetDirectorySize(It.IsAny<String>()))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(c => c.FolderExists(It.IsAny<String>()))
|
||||
.Returns(true);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<PostDownloadProvider>().ProcessDropFolder(@"C:\drop\");
|
||||
|
||||
|
||||
//Assert
|
||||
Mocker.GetMock<DiskScanProvider>().Verify(c => c.Scan(It.IsAny<Series>(), subFolders[0]), Times.Once());
|
||||
Mocker.GetMock<DiskScanProvider>().Verify(c => c.Scan(It.IsAny<Series>(), subFolders[1]), Times.Never());
|
||||
@ -112,6 +115,10 @@ public void ProcessDropFolder_should_process_individual_video_files_in_drop_fold
|
||||
.Setup(c => c.GetDirectorySize(It.IsAny<String>()))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(c => c.FolderExists(It.IsAny<String>()))
|
||||
.Returns(true);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<PostDownloadProvider>().ProcessDropFolder(@"C:\drop\");
|
||||
|
||||
|
@ -49,6 +49,10 @@ private void WithValidSeries()
|
||||
Mocker.GetMock<SeriesProvider>()
|
||||
.Setup(c => c.FindSeries(It.IsAny<string>()))
|
||||
.Returns(fakeSeries);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FolderExists(fakeSeries.Path))
|
||||
.Returns(true);
|
||||
}
|
||||
|
||||
private void WithImportableFiles()
|
||||
@ -156,6 +160,10 @@ public void should_logError_and_return_if_size_exceeds_free_space()
|
||||
.Setup(s => s.FreeDiskSpace(new DirectoryInfo(series.Path)))
|
||||
.Returns(9);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FolderExists(series.Path))
|
||||
.Returns(true);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<PostDownloadProvider>().ProcessVideoFile(downloadName);
|
||||
|
||||
@ -211,5 +219,32 @@ public void should_process_if_free_disk_space_equals_size()
|
||||
//Assert
|
||||
Mocker.GetMock<DiskScanProvider>().Verify(c => c.ImportFile(fakeSeries, downloadName), Times.Once());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_if_series_Path_doesnt_exist()
|
||||
{
|
||||
var downloadName = @"C:\Test\Drop\30.Rock.S01E01.Pilot.mkv";
|
||||
|
||||
WithValidSeries();
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.GetDirectorySize(downloadName))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FreeDiskSpace(It.IsAny<DirectoryInfo>()))
|
||||
.Returns(10);
|
||||
|
||||
Mocker.GetMock<DiskProvider>()
|
||||
.Setup(s => s.FolderExists(fakeSeries.Path))
|
||||
.Returns(false);
|
||||
|
||||
//Act
|
||||
Mocker.Resolve<PostDownloadProvider>().ProcessVideoFile(downloadName);
|
||||
|
||||
|
||||
//Assert
|
||||
ExceptionVerification.ExpectedWarns(1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user