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

View File

@@ -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();
}
}
}