|
|
@ -1,26 +1,28 @@
|
|
|
|
// ReSharper disable RedundantUsingDirective
|
|
|
|
// ReSharper disable RedundantUsingDirective
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FluentAssertions;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Organizer;
|
|
|
|
using NzbDrone.Core.Qualities;
|
|
|
|
using NzbDrone.Core.Qualities;
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
namespace NzbDrone.Core.Test.OrganizerTests
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
[TestFixture]
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
public class MediaFileProvider_GetNewFilenameTest : CoreTest
|
|
|
|
public class MediaFileProvider_GetNewFilenameTest : CoreTest<FileNameBuilder>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private Series _series;
|
|
|
|
private Series _series;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private NameSpecification nameSpecification;
|
|
|
|
|
|
|
|
|
|
|
|
[SetUp]
|
|
|
|
[SetUp]
|
|
|
|
public void Setup()
|
|
|
|
public void Setup()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -28,6 +30,15 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.CreateNew()
|
|
|
|
.CreateNew()
|
|
|
|
.With(s => s.Title = "South Park")
|
|
|
|
.With(s => s.Title = "South Park")
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nameSpecification = new NameSpecification();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mocker.GetMock<IBasicRepository<NameSpecification>>()
|
|
|
|
|
|
|
|
.Setup(c => c.SingleOrDefault()).Returns(nameSpecification);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
@ -36,13 +47,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -51,7 +62,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South Park - S15E06 - City Sushi [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("South Park - S15E06 - City Sushi [HDTV-720p]", result);
|
|
|
@ -63,13 +74,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -78,7 +89,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("15x06 - City Sushi [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("15x06 - City Sushi [HDTV-720p]", result);
|
|
|
@ -90,13 +101,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(1);
|
|
|
|
nameSpecification.SortingNumberStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -105,7 +116,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South Park 05x06 [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("South Park 05x06 [HDTV-720p]", result);
|
|
|
@ -117,13 +128,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3);
|
|
|
|
nameSpecification.SortingNumberStyle = 3;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
@ -133,7 +144,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South Park s05e06", result);
|
|
|
|
Assert.AreEqual("South Park s05e06", result);
|
|
|
@ -145,13 +156,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3);
|
|
|
|
nameSpecification.SortingNumberStyle = 3;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true);
|
|
|
|
nameSpecification.SortingReplaceSpaces = true;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -160,7 +171,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South.Park.s05e06.City.Sushi", result);
|
|
|
|
Assert.AreEqual("South.Park.s05e06.City.Sushi", result);
|
|
|
@ -172,13 +183,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3);
|
|
|
|
nameSpecification.SortingNumberStyle = 3;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true);
|
|
|
|
nameSpecification.SortingReplaceSpaces = true;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -187,7 +198,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South.Park.-.s05e06.-.City.Sushi.[HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("South.Park.-.s05e06.-.City.Sushi.[HDTV-720p]", result);
|
|
|
@ -199,13 +210,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
@ -215,7 +226,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("S15E06", result);
|
|
|
|
Assert.AreEqual("S15E06", result);
|
|
|
@ -227,14 +238,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 3;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -249,7 +260,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("The Mentalist - S03E23-E24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("The Mentalist - S03E23-E24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
@ -261,14 +272,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 2;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -283,7 +294,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("3x23x24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("3x23x24 - Strawberries and Cream [HDTV-720p]", result);
|
|
|
@ -295,14 +306,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 2;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -317,7 +328,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("3x23x24 Strawberries and Cream [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("3x23x24 Strawberries and Cream [HDTV-720p]", result);
|
|
|
@ -329,14 +340,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 1;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3);
|
|
|
|
nameSpecification.SortingNumberStyle = 3;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true);
|
|
|
|
nameSpecification.SortingReplaceSpaces = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(1);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 1;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -351,7 +362,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("The.Mentalist.s03e23.s03e24.Strawberries.and.Cream", result);
|
|
|
|
Assert.AreEqual("The.Mentalist.s03e23.s03e24.Strawberries.and.Cream", result);
|
|
|
@ -363,14 +374,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true);
|
|
|
|
nameSpecification.SortingReplaceSpaces = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(0);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 0;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -385,7 +396,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("The.Mentalist.-.S03E23-24", result);
|
|
|
|
Assert.AreEqual("The.Mentalist.-.S03E23-24", result);
|
|
|
@ -397,14 +408,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true);
|
|
|
|
nameSpecification.SortingReplaceSpaces = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 2;
|
|
|
|
|
|
|
|
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
var episodeOne = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
|
.With(e => e.Title = "Strawberries and Cream (1)")
|
|
|
@ -419,7 +430,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episodeOne, episodeTwo }, new Series { Title = "The Mentalist" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("3x23x24", result);
|
|
|
|
Assert.AreEqual("3x23x24", result);
|
|
|
@ -429,13 +440,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_should_append_proper_when_proper_and_append_quality_is_true()
|
|
|
|
public void GetNewFilename_should_append_proper_when_proper_and_append_quality_is_true()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -444,7 +455,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, true, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, true, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p] [Proper]");
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p] [Proper]");
|
|
|
@ -454,13 +465,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_not_proper_and_append_quality_is_true()
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_not_proper_and_append_quality_is_true()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -469,7 +480,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p]");
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi [HDTV-720p]");
|
|
|
@ -479,13 +490,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_proper_and_append_quality_is_false()
|
|
|
|
public void GetNewFilename_should_not_append_proper_when_proper_and_append_quality_is_false()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -494,7 +505,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, true, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, true, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi");
|
|
|
|
result.Should().Be("South Park - S15E06 - City Sushi");
|
|
|
@ -504,14 +515,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_should_order_multiple_episode_files_in_numerical_order()
|
|
|
|
public void GetNewFilename_should_order_multiple_episode_files_in_numerical_order()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 3;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Hey, Baby, What's Wrong? (1)")
|
|
|
|
.With(e => e.Title = "Hey, Baby, What's Wrong? (1)")
|
|
|
@ -526,7 +537,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
@ -538,13 +549,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(2);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -553,7 +564,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("South Park.S15E06.City Sushi [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("South Park.S15E06.City Sushi [HDTV-720p]", result);
|
|
|
@ -565,13 +576,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(2);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -580,7 +591,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
Assert.AreEqual("15x06.City Sushi [HDTV-720p]", result);
|
|
|
|
Assert.AreEqual("15x06.City Sushi [HDTV-720p]", result);
|
|
|
@ -590,14 +601,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNull()
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNull()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(2);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingUseSceneName).Returns(true);
|
|
|
|
nameSpecification.SortingUseSceneName = true;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -611,7 +622,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, episodeFile);
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, episodeFile);
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be(Path.GetFileNameWithoutExtension(episodeFile.Path));
|
|
|
|
result.Should().Be(Path.GetFileNameWithoutExtension(episodeFile.Path));
|
|
|
@ -621,14 +632,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNotNull()
|
|
|
|
public void GetNewFilename_UseSceneName_when_sceneName_isNotNull()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(2);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0);
|
|
|
|
nameSpecification.SortingNumberStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingUseSceneName).Returns(true);
|
|
|
|
nameSpecification.SortingUseSceneName = true;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
|
.With(e => e.Title = "City Sushi")
|
|
|
@ -642,7 +653,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, episodeFile);
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode }, _series, Quality.HDTV720p, false, episodeFile);
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be(episodeFile.SceneName);
|
|
|
|
result.Should().Be(episodeFile.SceneName);
|
|
|
@ -652,14 +663,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void should_only_have_one_episodeTitle_when_episode_titles_are_the_same()
|
|
|
|
public void should_only_have_one_episodeTitle_when_episode_titles_are_the_same()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 3;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Hey, Baby, What's Wrong? (1)")
|
|
|
|
.With(e => e.Title = "Hey, Baby, What's Wrong? (1)")
|
|
|
@ -674,7 +685,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hey, Baby, What's Wrong!");
|
|
|
@ -684,14 +695,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void should_have_two_episodeTitles_when_episode_titles_are_not_the_same()
|
|
|
|
public void should_have_two_episodeTitles_when_episode_titles_are_not_the_same()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 3;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Hello")
|
|
|
|
.With(e => e.Title = "Hello")
|
|
|
@ -706,7 +717,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode2, episode }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hello + World");
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07 - Hello + World");
|
|
|
@ -716,14 +727,14 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
public void should_have_two_episodeTitles_when_distinct_count_is_two()
|
|
|
|
public void should_have_two_episodeTitles_when_distinct_count_is_two()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Setup
|
|
|
|
//Setup
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3);
|
|
|
|
nameSpecification.SortingMultiEpisodeStyle = 3;
|
|
|
|
|
|
|
|
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
var episode = Builder<Episode>.CreateNew()
|
|
|
|
.With(e => e.Title = "Hello (3)")
|
|
|
|
.With(e => e.Title = "Hello (3)")
|
|
|
@ -744,7 +755,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
//Act
|
|
|
|
string result = Mocker.Resolve<IMediaFileService>().GetNewFilename(new List<Episode> { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
string result = Subject.GetNewFilename(new List<Episode> { episode, episode2, episode3 }, new Series { Title = "30 Rock" }, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
|
|
|
|
|
|
|
|
//Assert
|
|
|
|
//Assert
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07-E08 - Hello + World");
|
|
|
|
result.Should().Be("30 Rock - S06E06-E07-E08 - Hello + World");
|
|
|
@ -753,13 +764,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_use_airDate_if_series_isDaily()
|
|
|
|
public void should_use_airDate_if_series_isDaily()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true);
|
|
|
|
nameSpecification.SortingAppendQuality = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var series = Builder<Series>
|
|
|
|
var series = Builder<Series>
|
|
|
|
.CreateNew()
|
|
|
|
.CreateNew()
|
|
|
@ -774,7 +785,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<IMediaFileService>()
|
|
|
|
var result = Subject
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13 - Kristen Stewart [HDTV-720p]");
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13 - Kristen Stewart [HDTV-720p]");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -782,13 +793,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_use_airDate_if_series_isDaily_no_episode_title()
|
|
|
|
public void should_use_airDate_if_series_isDaily_no_episode_title()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(false);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var series = Builder<Series>
|
|
|
|
var series = Builder<Series>
|
|
|
|
.CreateNew()
|
|
|
|
.CreateNew()
|
|
|
@ -803,7 +814,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<IMediaFileService>()
|
|
|
|
var result = Subject
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13");
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - 2012-12-13");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -811,13 +822,13 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
[Test]
|
|
|
|
[Test]
|
|
|
|
public void should_set_airdate_to_unknown_if_not_available()
|
|
|
|
public void should_set_airdate_to_unknown_if_not_available()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var fakeConfig = Mocker.GetMock<IConfigService>();
|
|
|
|
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeSeriesName = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingIncludeEpisodeTitle).Returns(true);
|
|
|
|
nameSpecification.SortingIncludeEpisodeTitle = true;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false);
|
|
|
|
nameSpecification.SortingAppendQuality = false;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0);
|
|
|
|
nameSpecification.SortingSeparatorStyle = 0;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2);
|
|
|
|
nameSpecification.SortingNumberStyle = 2;
|
|
|
|
fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false);
|
|
|
|
nameSpecification.SortingReplaceSpaces = false;
|
|
|
|
|
|
|
|
|
|
|
|
var series = Builder<Series>
|
|
|
|
var series = Builder<Series>
|
|
|
|
.CreateNew()
|
|
|
|
.CreateNew()
|
|
|
@ -832,7 +843,7 @@ namespace NzbDrone.Core.Test.MediaFileTests
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.With(e => e.Title = "Kristen Stewart")
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
var result = Mocker.Resolve<IMediaFileService>()
|
|
|
|
var result = Subject
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
.GetNewFilename(episodes, series, Quality.HDTV720p, false, new EpisodeFile());
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - Unknown - Kristen Stewart");
|
|
|
|
result.Should().Be("The Daily Show with Jon Stewart - Unknown - Kristen Stewart");
|
|
|
|
}
|
|
|
|
}
|