|
|
@ -25,9 +25,6 @@ namespace NzbDrone.Core.Test
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
public class MediaFileProviderTests : TestBase
|
|
|
|
public class MediaFileProviderTests : TestBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void get_series_files()
|
|
|
|
public void get_series_files()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -136,5 +133,30 @@ namespace NzbDrone.Core.Test
|
|
|
|
result.Should().OnlyContain(e => e.EpisodeFileId > 0);
|
|
|
|
result.Should().OnlyContain(e => e.EpisodeFileId > 0);
|
|
|
|
ExceptionVerification.ExcpectedWarns(1);
|
|
|
|
ExceptionVerification.ExcpectedWarns(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
|
|
[TestCase("30 Rock - S01E05 - Episode Title", 1, true, "Season %0s", @"C:\Test\30 Rock\Season 01\30 Rock - S01E05 - Episode Title.mkv")]
|
|
|
|
|
|
|
|
[TestCase("30 Rock - S01E05 - Episode Title", 1, true, "Season %s", @"C:\Test\30 Rock\Season 1\30 Rock - S01E05 - Episode Title.mkv")]
|
|
|
|
|
|
|
|
[TestCase("30 Rock - S01E05 - Episode Title", 1, false, "Season %0s", @"C:\Test\30 Rock\30 Rock - S01E05 - Episode Title.mkv")]
|
|
|
|
|
|
|
|
[TestCase("30 Rock - S01E05 - Episode Title", 1, false, "Season %s", @"C:\Test\30 Rock\30 Rock - S01E05 - Episode Title.mkv")]
|
|
|
|
|
|
|
|
[TestCase("30 Rock - S01E05 - Episode Title", 1, true, "ReallyUglySeasonFolder %s", @"C:\Test\30 Rock\ReallyUglySeasonFolder 1\30 Rock - S01E05 - Episode Title.mkv")]
|
|
|
|
|
|
|
|
public void CalculateFilePath_SeasonFolder_SingleNumber(string filename, int seasonNumber, bool useSeasonFolder, string seasonFolderFormat, string expectedPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
var fakeSeries = Builder<Series>.CreateNew()
|
|
|
|
|
|
|
|
.With(s => s.Title = "30 Rock")
|
|
|
|
|
|
|
|
.With(s => s.Path = @"C:\Test\30 Rock")
|
|
|
|
|
|
|
|
.With(s => s.SeasonFolder = useSeasonFolder)
|
|
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mocker = new AutoMoqer();
|
|
|
|
|
|
|
|
mocker.GetMock<ConfigProvider>().Setup(e => e.SeasonFolderFormat).Returns(seasonFolderFormat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
|
|
|
var result = mocker.Resolve<MediaFileProvider>().CalculateFilePath(fakeSeries, 1, filename, ".mkv");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
|
|
|
|
Assert.AreEqual(expectedPath, result.FullName);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|