jellyfin-server/tests/Jellyfin.Naming.Tests/TV/SeasonFolderTests.cs

32 lines
1.1 KiB
C#
Raw Normal View History

2019-12-06 19:40:06 +00:00
using Emby.Naming.TV;
using Xunit;
namespace Jellyfin.Naming.Tests.TV
{
public class SeasonFolderTests
{
[Theory]
[InlineData(@"/Drive/Season 1", 1)]
[InlineData(@"/Drive/Season 2", 2)]
[InlineData(@"/Drive/Season 02", 2)]
[InlineData(@"/Drive/Seinfeld/S02", 2)]
[InlineData(@"/Drive/Seinfeld/2", 2)]
[InlineData(@"/Drive/Season 2009", 2009)]
[InlineData(@"/Drive/Season1", 1)]
[InlineData(@"The Wonder Years/The.Wonder.Years.S04.PDTV.x264-JCH", 4)]
[InlineData(@"/Drive/Season 7 (2016)", 7)]
[InlineData(@"/Drive/Staffel 7 (2016)", 7)]
[InlineData(@"/Drive/Stagione 7 (2016)", 7)]
[InlineData(@"/Drive/Season (8)", null)]
[InlineData(@"/Drive/3.Staffel", 3)]
[InlineData(@"/Drive/s06e05", null)]
[InlineData(@"/Drive/The.Legend.of.Condor.Heroes.2017.V2.web-dl.1080p.h264.aac-hdctv", null)]
public void GetSeasonNumberFromPathTest(string path, int? seasonNumber)
2019-12-06 19:40:06 +00:00
{
2020-01-22 21:18:56 +00:00
var result = SeasonPathParser.Parse(path, true, true);
2019-12-06 19:40:06 +00:00
Assert.Equal(result.SeasonNumber, seasonNumber);
2019-12-06 19:40:06 +00:00
}
}
}