1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

FreeSpaceSpec will return true is free space check returns null

This commit is contained in:
Mark McDowall
2013-09-13 17:41:14 -07:00
parent 89d603d71c
commit d4096f8786
7 changed files with 34 additions and 12 deletions
@@ -123,14 +123,24 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
[Test]
public void should_skip_check_for_files_under_series_folder()
{
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.IsParent(It.IsAny<String>(), It.IsAny<String>()))
.Returns(true);
_localEpisode.ExistingFile = true;
Subject.IsSatisfiedBy(_localEpisode).Should().BeTrue();
Mocker.GetMock<IDiskProvider>()
.Verify(s => s.GetAvailableSpace(It.IsAny<String>()), Times.Never());
}
[Test]
public void should_return_true_if_free_space_is_null()
{
long? freeSpace = null;
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.GetAvailableSpace(It.IsAny<String>()))
.Returns(freeSpace);
Subject.IsSatisfiedBy(_localEpisode).Should().BeTrue();
}
}
}
@@ -29,9 +29,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
private void GivenChildOfSeries()
{
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.IsParent(_localEpisode.Series.Path, _localEpisode.Path))
.Returns(true);
_localEpisode.ExistingFile = true;
}
private void GivenNewFile()