From a228bd8f1c94c05eff88fd928cba49ae7412f432 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 11:26:41 -0800 Subject: [PATCH] Added test for series folder name --- .../OrganizerTests/BuildFilePathFixture.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs index 11866ea54..b7821aaf8 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs @@ -43,5 +43,23 @@ public void CalculateFilePath_SeasonFolder_SingleNumber(string filename, int sea Subject.BuildFilePath(fakeSeries, seasonNumber, filename, ".mkv").Should().Be(expectedPath.AsOsAgnostic()); } + + [Test] + public void should_clean_season_folder_when_it_contains_illegal_characters_in_series_title() + { + var filename = @"S01E05 - Episode Title"; + var seasonNumber = 1; + var expectedPath = @"C:\Test\NCIS- Los Angeles\NCIS- Los Angeles Season 1\S01E05 - Episode Title.mkv"; + + var fakeSeries = Builder.CreateNew() + .With(s => s.Title = "NCIS: Los Angeles") + .With(s => s.Path = @"C:\Test\NCIS- Los Angeles".AsOsAgnostic()) + .With(s => s.SeasonFolder = true) + .Build(); + + namingConfig.SeasonFolderFormat = "{Series Title} Season {season:0}"; + + Subject.BuildFilePath(fakeSeries, seasonNumber, filename, ".mkv").Should().Be(expectedPath.AsOsAgnostic()); + } } } \ No newline at end of file