mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-05 09:52:10 +01:00
Merge branch 'master' into what_could_go_wrong
This commit is contained in:
@@ -55,35 +55,5 @@ namespace Jellyfin.Api.Tests.Helpers
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void GetItemTypeStrings_Empty_Empty()
|
||||
{
|
||||
Assert.Empty(RequestHelpers.GetItemTypeStrings(Array.Empty<BaseItemKind>()));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void GetItemTypeStrings_Valid_Success()
|
||||
{
|
||||
BaseItemKind[] input =
|
||||
{
|
||||
BaseItemKind.AggregateFolder,
|
||||
BaseItemKind.Audio,
|
||||
BaseItemKind.BasePluginFolder,
|
||||
BaseItemKind.CollectionFolder
|
||||
};
|
||||
|
||||
string[] expected =
|
||||
{
|
||||
"AggregateFolder",
|
||||
"Audio",
|
||||
"BasePluginFolder",
|
||||
"CollectionFolder"
|
||||
};
|
||||
|
||||
var res = RequestHelpers.GetItemTypeStrings(input);
|
||||
|
||||
Assert.Equal(expected, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Net;
|
||||
using Xunit;
|
||||
|
||||
@@ -129,7 +124,7 @@ namespace Jellyfin.Model.Tests.Net
|
||||
[InlineData("font/woff2", ".woff2")]
|
||||
[InlineData("image/bmp", ".bmp")]
|
||||
[InlineData("image/gif", ".gif")]
|
||||
[InlineData("image/jpg", ".jpg")]
|
||||
[InlineData("image/jpeg", ".jpg")]
|
||||
[InlineData("image/png", ".png")]
|
||||
[InlineData("image/svg+xml", ".svg")]
|
||||
[InlineData("image/tiff", ".tif")]
|
||||
|
||||
@@ -11,6 +11,18 @@ namespace Jellyfin.Server.Implementations.Tests.Library
|
||||
[InlineData("Superman: Red Son - tt10985510", "imdbid", "tt10985510")]
|
||||
[InlineData("Superman: Red Son", "imdbid", null)]
|
||||
[InlineData("Superman: Red Son", "something", null)]
|
||||
[InlineData("Superman: Red Son [imdbid1=tt11111111][imdbid=tt10985510]", "imdbid", "tt10985510")]
|
||||
[InlineData("Superman: Red Son [tmdbid=618355][imdbid=tt10985510]", "imdbid", "tt10985510")]
|
||||
[InlineData("Superman: Red Son [tmdbid=618355][imdbid=tt10985510]", "tmdbid", "618355")]
|
||||
[InlineData("[tmdbid=618355]", "tmdbid", "618355")]
|
||||
[InlineData("tmdbid=111111][tmdbid=618355]", "tmdbid", "618355")]
|
||||
[InlineData("[tmdbid=618355]tmdbid=111111]", "tmdbid", "618355")]
|
||||
[InlineData("tmdbid=618355]", "tmdbid", null)]
|
||||
[InlineData("[tmdbid=618355", "tmdbid", null)]
|
||||
[InlineData("tmdbid=618355", "tmdbid", null)]
|
||||
[InlineData("tmdbid=", "tmdbid", null)]
|
||||
[InlineData("tmdbid", "tmdbid", null)]
|
||||
[InlineData("[tmdbid=][imdbid=tt10985510]", "tmdbid", null)]
|
||||
public void GetAttributeValue_ValidArgs_Correct(string input, string attribute, string? expectedResult)
|
||||
{
|
||||
Assert.Equal(expectedResult, PathExtensions.GetAttributeValue(input, attribute));
|
||||
|
||||
Reference in New Issue
Block a user