aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj2
-rw-r--r--tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj2
-rw-r--r--tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj2
-rw-r--r--tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj2
-rw-r--r--tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj2
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs66
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj2
7 files changed, 51 insertions, 27 deletions
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index bb0357c06..b159db2bd 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
<PackageReference Include="Moq" Version="4.13.1" />
</ItemGroup>
diff --git a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
index c81b820d9..81a2242e7 100644
--- a/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
+++ b/tests/Jellyfin.Common.Tests/Jellyfin.Common.Tests.csproj
@@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
</ItemGroup>
<ItemGroup>
diff --git a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
index 06c10afe1..30994dee6 100644
--- a/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
+++ b/tests/Jellyfin.Controller.Tests/Jellyfin.Controller.Tests.csproj
@@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
</ItemGroup>
<ItemGroup>
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
index 52d28206d..78a020ad5 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
+++ b/tests/Jellyfin.MediaEncoding.Tests/Jellyfin.MediaEncoding.Tests.csproj
@@ -17,7 +17,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
</ItemGroup>
<ItemGroup>
diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
index 4a583bcc7..f404b3e46 100644
--- a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
+++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj
@@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
</ItemGroup>
<ItemGroup>
diff --git a/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs b/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
index 1646237a0..a64d17349 100644
--- a/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
@@ -7,6 +7,8 @@ namespace Jellyfin.Naming.Tests.Video
{
public class ExtraTests : BaseVideoTest
{
+ private readonly NamingOptions _videoOptions = new NamingOptions();
+
// Requirements
// movie-deleted = ExtraType deletedscene
@@ -15,42 +17,64 @@ namespace Jellyfin.Naming.Tests.Video
[Fact]
public void TestKodiExtras()
{
- var videoOptions = new NamingOptions();
-
- Test("trailer.mp4", ExtraType.Trailer, videoOptions);
- Test("300-trailer.mp4", ExtraType.Trailer, videoOptions);
+ Test("trailer.mp4", ExtraType.Trailer, _videoOptions);
+ Test("300-trailer.mp4", ExtraType.Trailer, _videoOptions);
- Test("theme.mp3", ExtraType.ThemeSong, videoOptions);
+ Test("theme.mp3", ExtraType.ThemeSong, _videoOptions);
}
[Fact]
public void TestExpandedExtras()
{
- var videoOptions = new NamingOptions();
+ Test("trailer.mp4", ExtraType.Trailer, _videoOptions);
+ Test("trailer.mp3", null, _videoOptions);
+ Test("300-trailer.mp4", ExtraType.Trailer, _videoOptions);
- Test("trailer.mp4", ExtraType.Trailer, videoOptions);
- Test("trailer.mp3", null, videoOptions);
- Test("300-trailer.mp4", ExtraType.Trailer, videoOptions);
+ Test("theme.mp3", ExtraType.ThemeSong, _videoOptions);
+ Test("theme.mkv", null, _videoOptions);
- Test("theme.mp3", ExtraType.ThemeSong, videoOptions);
- Test("theme.mkv", null, videoOptions);
+ Test("300-scene.mp4", ExtraType.Scene, _videoOptions);
+ Test("300-scene2.mp4", ExtraType.Scene, _videoOptions);
+ Test("300-clip.mp4", ExtraType.Clip, _videoOptions);
+
+ Test("300-deleted.mp4", ExtraType.DeletedScene, _videoOptions);
+ Test("300-deletedscene.mp4", ExtraType.DeletedScene, _videoOptions);
+ Test("300-interview.mp4", ExtraType.Interview, _videoOptions);
+ Test("300-behindthescenes.mp4", ExtraType.BehindTheScenes, _videoOptions);
+ }
- Test("300-scene.mp4", ExtraType.Scene, videoOptions);
- Test("300-scene2.mp4", ExtraType.Scene, videoOptions);
- Test("300-clip.mp4", ExtraType.Clip, videoOptions);
+ [Theory]
+ [InlineData(ExtraType.BehindTheScenes, "behind the scenes" )]
+ [InlineData(ExtraType.DeletedScene, "deleted scenes" )]
+ [InlineData(ExtraType.Interview, "interviews" )]
+ [InlineData(ExtraType.Scene, "scenes" )]
+ [InlineData(ExtraType.Sample, "samples" )]
+ [InlineData(ExtraType.Clip, "shorts" )]
+ [InlineData(ExtraType.Clip, "featurettes" )]
+ [InlineData(ExtraType.Unknown, "extras" )]
+ public void TestDirectories(ExtraType type, string dirName)
+ {
+ Test(dirName + "/300.mp4", type, _videoOptions);
+ Test("300/" + dirName + "/something.mkv", type, _videoOptions);
+ Test("/data/something/Movies/300/" + dirName + "/whoknows.mp4", type, _videoOptions);
+ }
- Test("300-deleted.mp4", ExtraType.DeletedScene, videoOptions);
- Test("300-deletedscene.mp4", ExtraType.DeletedScene, videoOptions);
- Test("300-interview.mp4", ExtraType.Interview, videoOptions);
- Test("300-behindthescenes.mp4", ExtraType.BehindTheScenes, videoOptions);
+ [Theory]
+ [InlineData("gibberish")]
+ [InlineData("not a scene")]
+ [InlineData("The Big Short")]
+ public void TestNonExtraDirectories(string dirName)
+ {
+ Test(dirName + "/300.mp4", null, _videoOptions);
+ Test("300/" + dirName + "/something.mkv", null, _videoOptions);
+ Test("/data/something/Movies/300/" + dirName + "/whoknows.mp4", null, _videoOptions);
+ Test("/data/something/Movies/" + dirName + "/" + dirName + ".mp4", null, _videoOptions);
}
[Fact]
public void TestSample()
{
- var videoOptions = new NamingOptions();
-
- Test("300-sample.mp4", ExtraType.Sample, videoOptions);
+ Test("300-sample.mp4", ExtraType.Sample, _videoOptions);
}
private void Test(string input, ExtraType? expectedType, NamingOptions videoOptions)
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
index 29733a1c4..b7865439c 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
+++ b/tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj
@@ -14,7 +14,7 @@
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
- <PackageReference Include="coverlet.collector" Version="1.2.0" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
</ItemGroup>
<ItemGroup>