2019-12-06 19:40:06 +00:00
|
|
|
|
using Emby.Naming.Common;
|
|
|
|
|
using Emby.Naming.TV;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Naming.Tests.TV
|
|
|
|
|
{
|
|
|
|
|
public class AbsoluteEpisodeNumberTests
|
|
|
|
|
{
|
2022-01-04 16:59:30 +00:00
|
|
|
|
private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions());
|
|
|
|
|
|
2020-02-27 02:31:57 +00:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData("The Simpsons/12.avi", 12)]
|
|
|
|
|
[InlineData("The Simpsons/The Simpsons 12.avi", 12)]
|
|
|
|
|
[InlineData("The Simpsons/The Simpsons 82.avi", 82)]
|
|
|
|
|
[InlineData("The Simpsons/The Simpsons 112.avi", 112)]
|
|
|
|
|
[InlineData("The Simpsons/Foo_ep_02.avi", 2)]
|
|
|
|
|
[InlineData("The Simpsons/The Simpsons 889.avi", 889)]
|
|
|
|
|
[InlineData("The Simpsons/The Simpsons 101.avi", 101)]
|
|
|
|
|
public void GetEpisodeNumberFromFileTest(string path, int episodeNumber)
|
2019-12-06 19:40:06 +00:00
|
|
|
|
{
|
2022-01-04 16:59:30 +00:00
|
|
|
|
var result = _resolver.Resolve(path, false, null, null, true);
|
2019-12-06 19:40:06 +00:00
|
|
|
|
|
2020-05-13 22:59:19 +00:00
|
|
|
|
Assert.Equal(episodeNumber, result?.EpisodeNumber);
|
2019-12-06 19:40:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|