Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/jellyfin/src/commit/9f259aa404a4bf4185f22ece9a13be2a7ae346df/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonBoolStringTests.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
jellyfin/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonBoolStringTests.cs

38 lines
1.1 KiB

using System.Text.Json;
using Jellyfin.Extensions.Json.Converters;
using Xunit;
namespace Jellyfin.Extensions.Tests.Json.Converters
{
public class JsonBoolStringTests
{
private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions()
{
Converters =
{
new JsonBoolStringConverter()
}
};
[Theory]
[InlineData(@"{ ""Value"": ""true"" }", true)]
[InlineData(@"{ ""Value"": ""false"" }", false)]
public void Deserialize_String_Valid_Success(string input, bool output)
{
var s = JsonSerializer.Deserialize<TestStruct>(input, _jsonOptions);
Assert.Equal(s.Value, output);
}
[Theory]
[InlineData(true, "true")]
[InlineData(false, "false")]
public void Serialize_Bool_Success(bool input, string output)
{
var value = JsonSerializer.Serialize(input, _jsonOptions);
Assert.Equal(value, output);
}
private readonly record struct TestStruct(bool Value);
}
}