From c6159414ec0c57a96fdce48c889c420fb8bf711e Mon Sep 17 00:00:00 2001 From: Erik Frantz Date: Sun, 30 Nov 2025 22:37:30 -0600 Subject: [PATCH] Adding a test without `Movie CollectionThe` in it --- .../OrganizerTests/GetMovieFolderFixture.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/OrganizerTests/GetMovieFolderFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/GetMovieFolderFixture.cs index 563cd52965..75809ed7fe 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/GetMovieFolderFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/GetMovieFolderFixture.cs @@ -36,6 +36,7 @@ public void should_use_movieFolderFormat_to_build_folder_name(string movieTitle, [TestCase("The Y-Women Collection", "The Y-Women 14", 2005, "{Movie CollectionThe}/{Movie TitleThe} ({Release Year})", "Y-Women Collection, The", "Y-Women 14, The (2005)")] [TestCase("A Decade of Changes", "The First Year", 1980, "{Movie CollectionThe}/{Movie TitleThe} ({Release Year})", "Decade of Changes, A", "First Year, The (1980)")] + [TestCase(null, "Just a Movie", 1999, "{Movie Title} ({Release Year})", null, "Just a Movie (1999)")] public void should_use_movieFolderFormat_and_CollectionFormat_to_build_folder_name(string collectionTitle, string movieTitle, int year, string format, string expectedCollection, string expectedTitle) { _namingConfig.MovieFolderFormat = format; @@ -51,7 +52,9 @@ public void should_use_movieFolderFormat_and_CollectionFormat_to_build_folder_na }; var result = Subject.GetMovieFolder(movie); - var expected = Path.Combine(expectedCollection, expectedTitle); + var expected = !string.IsNullOrWhiteSpace(expectedCollection) + ? Path.Combine(expectedCollection, expectedTitle) + : expectedTitle; result.Should().Be(expected); } }