Add in test for GetMovieFolderFixture

This commit is contained in:
Erik Frantz 2025-11-30 18:09:05 -06:00
parent 235699070e
commit 6d8b9fc112

View file

@ -1,3 +1,4 @@
using System.IO;
using FluentAssertions; using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.Movies; using NzbDrone.Core.Movies;
@ -32,5 +33,25 @@ public void should_use_movieFolderFormat_to_build_folder_name(string movieTitle,
Subject.GetMovieFolder(movie).Should().Be(expected); Subject.GetMovieFolder(movie).Should().Be(expected);
} }
[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)")]
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;
var movie = new Movie
{
MovieMetadata = new MovieMetadata
{
CollectionTitle = collectionTitle,
Title = movieTitle,
Year = year,
},
};
var result = Subject.GetMovieFolder(movie);
var expected = Path.Combine(expectedCollection, expectedTitle);
result.Should().Be(expected);
}
} }
} }