Fixed issue with create series directory on import

This commit is contained in:
Mark McDowall 2013-03-21 08:40:44 -07:00
parent 0d4bda1e1e
commit d6ad5ebb36
2 changed files with 9 additions and 1 deletions

View File

@ -425,11 +425,20 @@ namespace NzbDrone.Core.Test.ProviderTests.PostDownloadProviderTests
var downloadName = new DirectoryInfo(@"C:\Test\Drop\30.Rock.S01E01.Pilot"); var downloadName = new DirectoryInfo(@"C:\Test\Drop\30.Rock.S01E01.Pilot");
WithValidSeries(); WithValidSeries();
WithLotsOfFreeDiskSpace();
WithImportedFiles(downloadName.FullName);
Mocker.GetMock<DiskProvider>() Mocker.GetMock<DiskProvider>()
.Setup(s => s.FolderExists(fakeSeries.Path)) .Setup(s => s.FolderExists(fakeSeries.Path))
.Returns(false); .Returns(false);
Mocker.GetMock<SeriesProvider>().Setup(s => s.FindSeries("office")).Returns(fakeSeries);
Mocker.GetMock<DiskScanProvider>().Setup(s => s.CleanUpDropFolder(downloadName.FullName));
Mocker.GetMock<DiskScanProvider>().Setup(s => s.MoveEpisodeFile(It.IsAny<EpisodeFile>(), true)).Returns(new EpisodeFile());
Mocker.GetMock<DiskProvider>().Setup(s => s.GetDirectorySize(downloadName.FullName)).Returns(Constants.IgnoreFileSize - 1.Megabytes());
Mocker.GetMock<DiskProvider>().Setup(s => s.DeleteFolder(downloadName.FullName, true));
Mocker.GetMock<DiskProvider>().Setup(s => s.IsFolderLocked(downloadName.FullName)).Returns(false);
Mocker.Resolve<PostDownloadProvider>().ProcessDownload(downloadName); Mocker.Resolve<PostDownloadProvider>().ProcessDownload(downloadName);
Mocker.GetMock<DiskProvider>().Verify(c => c.CreateDirectory(fakeSeries.Path), Times.Once()); Mocker.GetMock<DiskProvider>().Verify(c => c.CreateDirectory(fakeSeries.Path), Times.Once());

View File

@ -89,7 +89,6 @@ namespace NzbDrone.Core.Providers
{ {
Logger.Warn("Series Folder doesn't exist: {0}, creating it.", series.Path); Logger.Warn("Series Folder doesn't exist: {0}, creating it.", series.Path);
_diskProvider.CreateDirectory(series.Path); _diskProvider.CreateDirectory(series.Path);
return;
} }
var size = _diskProvider.GetDirectorySize(subfolderInfo.FullName); var size = _diskProvider.GetDirectorySize(subfolderInfo.FullName);