|
|
@ -1,4 +1,5 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
@ -19,12 +20,14 @@ namespace NzbDrone.Core.Test.MediaFileTests.EpisodeImportTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private Series _series;
|
|
|
|
private Series _series;
|
|
|
|
private LocalEpisode _localEpisode;
|
|
|
|
private LocalEpisode _localEpisode;
|
|
|
|
|
|
|
|
private const String ROOT_FOLDER = @"C:\Test\TV";
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
[SetUp]
|
|
|
|
public void Setup()
|
|
|
|
public void Setup()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_series = Builder<Series>.CreateNew()
|
|
|
|
_series = Builder<Series>.CreateNew()
|
|
|
|
.With(s => s.SeriesType = SeriesTypes.Standard)
|
|
|
|
.With(s => s.SeriesType = SeriesTypes.Standard)
|
|
|
|
|
|
|
|
.With(s => s.Path = Path.Combine(ROOT_FOLDER, "30 Rock"))
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
var episodes = Builder<Episode>.CreateListOfSize(1)
|
|
|
|
var episodes = Builder<Episode>.CreateListOfSize(1)
|
|
|
@ -81,5 +84,17 @@ namespace NzbDrone.Core.Test.MediaFileTests.EpisodeImportTests
|
|
|
|
|
|
|
|
|
|
|
|
Subject.IsSatisfiedBy(_localEpisode).Should().BeTrue();
|
|
|
|
Subject.IsSatisfiedBy(_localEpisode).Should().BeTrue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
public void should_use_series_paths_parent_for_free_space_check()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GivenFileSize(100.Megabytes());
|
|
|
|
|
|
|
|
GivenFreeSpace(1.Gigabytes());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Subject.IsSatisfiedBy(_localEpisode).Should().BeTrue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IDiskProvider>()
|
|
|
|
|
|
|
|
.Verify(v => v.GetAvilableSpace(ROOT_FOLDER), Times.Once());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|