This should in the future help to detect working and non working name matchingspull/1877/head
parent
d8c3b26fa6
commit
8da012c8c5
@ -0,0 +1,25 @@
|
|||||||
|
namespace Emby.Naming.TV
|
||||||
|
{
|
||||||
|
using Emby.Naming.Common;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
public class EpisodePathParserTest
|
||||||
|
{
|
||||||
|
[Theory]
|
||||||
|
[InlineData("/media/Foo/Foo-S01E01", "Foo", 1, 1)]
|
||||||
|
[InlineData("/media/Foo - S04E011", "Foo", 4, 11)]
|
||||||
|
[InlineData("/media/Foo/Foo s01x01", "Foo", 1, 1)]
|
||||||
|
[InlineData("/media/Foo/Foo s01x03 - the bar of foo", "Foo", 1, 3)]
|
||||||
|
public void ParseEpisodesCorrectly(string path, string name, int season, int episode)
|
||||||
|
{
|
||||||
|
NamingOptions o = new NamingOptions();
|
||||||
|
EpisodePathParser p = new EpisodePathParser(o);
|
||||||
|
var res = p.Parse(path, false);
|
||||||
|
|
||||||
|
Assert.True(res.Success);
|
||||||
|
Assert.Equal(name, res.SeriesName);
|
||||||
|
Assert.Equal(season, res.SeasonNumber);
|
||||||
|
Assert.Equal(episode, res.EpisodeNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
|
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||||
|
<PackageReference Include="xunit" Version="2.4.0" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="1.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Emby.Naming\Emby.Naming.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Reference in new issue