aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs8
-rw-r--r--tests/Jellyfin.Common.Tests/Models/BoolTypeModel.cs17
2 files changed, 4 insertions, 21 deletions
diff --git a/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs b/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
index 1cae5b849..3779e2d0a 100644
--- a/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
+++ b/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
@@ -1,5 +1,5 @@
using System.Text.Json;
-using Jellyfin.Common.Tests.Models;
+using MediaBrowser.Common.Json.Converters;
using Xunit;
namespace Jellyfin.Common.Tests.Json
@@ -14,10 +14,10 @@ namespace Jellyfin.Common.Tests.Json
[InlineData("false", false)]
public static void Deserialize_Number_Valid_Success(string input, bool? output)
{
- var inputJson = $"{{ \"Value\": {input} }}";
var options = new JsonSerializerOptions();
- var value = JsonSerializer.Deserialize<BoolTypeModel>(inputJson, options);
- Assert.Equal(value?.Value, output);
+ options.Converters.Add(new JsonBoolNumberConverter());
+ var value = JsonSerializer.Deserialize<bool>(input, options);
+ Assert.Equal(value, output);
}
}
} \ No newline at end of file
diff --git a/tests/Jellyfin.Common.Tests/Models/BoolTypeModel.cs b/tests/Jellyfin.Common.Tests/Models/BoolTypeModel.cs
deleted file mode 100644
index feb952efc..000000000
--- a/tests/Jellyfin.Common.Tests/Models/BoolTypeModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System.Text.Json.Serialization;
-using MediaBrowser.Common.Json.Converters;
-
-namespace Jellyfin.Common.Tests.Models
-{
- /// <summary>
- /// The bool type model.
- /// </summary>
- public class BoolTypeModel
- {
- /// <summary>
- /// Gets or sets a value indicating whether the value is true or false.
- /// </summary>
- [JsonConverter(typeof(JsonBoolNumberConverter))]
- public bool Value { get; set; }
- }
-} \ No newline at end of file