From 41cb5c02e8a8090d36175220253e1ec6eb1c2f67 Mon Sep 17 00:00:00 2001 From: kayone Date: Wed, 13 Nov 2013 18:08:20 -0800 Subject: [PATCH] added tests for when patter doesn't match our 'expected casing' --- .../OrganizerTests/GetNewFilenameFixture.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/NzbDrone.Core.Test/OrganizerTests/GetNewFilenameFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/GetNewFilenameFixture.cs index 1a94f38a2..44efa406c 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/GetNewFilenameFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/GetNewFilenameFixture.cs @@ -102,6 +102,15 @@ public void should_replace_SERIES_TITLE_with_all_caps() .Should().Be("SOUTH PARK"); } + [Test] + public void should_replace_SERIES_TITLE_with_random_casing_should_keep_original_casing() + { + _namingConfig.StandardEpisodeFormat = "{sErIES-tItLE}"; + + Subject.BuildFilename(new List { _episode1 }, _series, _episodeFile) + .Should().Be(_series.Title.Replace(' ', '-')); + } + [Test] public void should_replace_series_title_with_all_lower_case() { @@ -111,6 +120,8 @@ public void should_replace_series_title_with_all_lower_case() .Should().Be("south park"); } + + [Test] public void should_replace_episode_title() { @@ -120,6 +131,15 @@ public void should_replace_episode_title() .Should().Be("City Sushi"); } + [Test] + public void should_replace_episode_title_if_pattern_has_random_casing() + { + _namingConfig.StandardEpisodeFormat = "{ePisOde-TitLe}"; + + Subject.BuildFilename(new List { _episode1 }, _series, _episodeFile) + .Should().Be("City-Sushi"); + } + [Test] public void should_replace_season_number_with_single_digit() {