Files
pgsql-jellyfin/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs
T
wjones af1152b001 Refactor: standardize namespace and using directive style
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
2026-02-20 16:26:53 -05:00

79 lines
2.7 KiB
C#

// <copyright file="Format3DTests.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Naming.Tests.Video
{
using Emby.Naming.Common;
using Emby.Naming.Video;
using Xunit;
public class Format3DTests
{
private readonly NamingOptions _namingOptions = new NamingOptions();
[Fact]
public void TestKodiFormat3D()
{
Test("Super movie.3d.mp4", false, null);
Test("Super movie.3d.hsbs.mp4", true, "hsbs");
Test("Super movie.3d.sbs.mp4", true, "sbs");
Test("Super movie.3d.htab.mp4", true, "htab");
Test("Super movie.3d.tab.mp4", true, "tab");
Test("Super movie 3d hsbs.mp4", true, "hsbs");
}
[Fact]
public void Test3DName()
{
var result = VideoResolver.ResolveFile("C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv", _namingOptions);
Assert.Equal("hsbs", result?.Format3D);
Assert.Equal("Oblivion", result?.Name);
}
[Fact]
public void TestExpandedFormat3D()
{
// These were introduced for Media Browser 3
// Kodi conventions are preferred but these still need to be supported
Test("Super movie.3d.mp4", false, null);
Test("Super movie.3d.hsbs.mp4", true, "hsbs");
Test("Super movie.3d.sbs.mp4", true, "sbs");
Test("Super movie.3d.htab.mp4", true, "htab");
Test("Super movie.3d.tab.mp4", true, "tab");
Test("Super movie.hsbs.mp4", true, "hsbs");
Test("Super movie.sbs.mp4", true, "sbs");
Test("Super movie.htab.mp4", true, "htab");
Test("Super movie.tab.mp4", true, "tab");
Test("Super movie.sbs3d.mp4", true, "sbs3d");
Test("Super movie.3d.mvc.mp4", true, "mvc");
Test("Super movie [3d].mp4", false, null);
Test("Super movie [hsbs].mp4", true, "hsbs");
Test("Super movie [fsbs].mp4", true, "fsbs");
Test("Super movie [ftab].mp4", true, "ftab");
Test("Super movie [htab].mp4", true, "htab");
Test("Super movie [sbs3d].mp4", true, "sbs3d");
}
private void Test(string input, bool is3D, string? format3D)
{
var result = Format3DParser.Parse(input, _namingOptions);
Assert.Equal(is3D, result.Is3D);
if (format3D is null)
{
Assert.Null(result?.Format3D);
}
else
{
Assert.Equal(format3D, result.Format3D, true);
}
}
}
}