Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/blame/commit/020c0fc4cba9657b3cddf6ea237bb00a59fdf118/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
jellyfin/tests/Jellyfin.Naming.Tests/Subtitles/SubtitleParserTests.cs

42 lines
1.6 KiB

5 years ago
using Emby.Naming.Common;
using Emby.Naming.Subtitles;
using Xunit;
namespace Jellyfin.Naming.Tests.Subtitles
{
public class SubtitleParserTests
{
5 years ago
private readonly NamingOptions _namingOptions = new NamingOptions();
5 years ago
[Theory]
[InlineData("The Skin I Live In (2011).srt", null, false, false)]
[InlineData("The Skin I Live In (2011).eng.srt", "eng", false, false)]
[InlineData("The Skin I Live In (2011).eng.default.srt", "eng", true, false)]
[InlineData("The Skin I Live In (2011).eng.forced.srt", "eng", false, true)]
[InlineData("The Skin I Live In (2011).eng.foreign.srt", "eng", false, true)]
[InlineData("The Skin I Live In (2011).eng.default.foreign.srt", "eng", true, true)]
[InlineData("The Skin I Live In (2011).default.foreign.eng.srt", "eng", true, true)]
5 years ago
public void SubtitleParser_ValidFileName_Parses(string input, string language, bool isDefault, bool isForced)
{
5 years ago
var parser = new SubtitleParser(_namingOptions);
var result = parser.ParseFile(input);
Assert.Equal(language, result?.Language, true);
Assert.Equal(isDefault, result?.IsDefault);
Assert.Equal(isForced, result?.IsForced);
Assert.Equal(input, result?.Path);
}
5 years ago
[Theory]
[InlineData("The Skin I Live In (2011).mp4")]
4 years ago
[InlineData("")]
5 years ago
public void SubtitleParser_InvalidFileName_ReturnsNull(string input)
5 years ago
{
var parser = new SubtitleParser(_namingOptions);
Assert.Null(parser.ParseFile(input));
}
}
}