aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnthony Lavado <anthony@lavado.ca>2020-12-08 12:08:24 -0500
committerGitHub <noreply@github.com>2020-12-08 12:08:24 -0500
commit94d805d03d93764365c5b63e23f239d47d23ad0a (patch)
tree9d3a20ef4bcac2474ebcb84be932b5c9ec5bf2a7 /tests
parent80ff564143b0745cba4b01b5378df6415f4072af (diff)
parent26e5aacb9096c448d6e545b1a2713972994f6418 (diff)
Merge pull request #4735 from crobibero/json-recursion
Fix JsonConverter recursion
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs b/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
index 3779e2d0a..9ded01f2b 100644
--- a/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
+++ b/tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs
@@ -19,5 +19,16 @@ namespace Jellyfin.Common.Tests.Json
var value = JsonSerializer.Deserialize<bool>(input, options);
Assert.Equal(value, output);
}
+
+ [Theory]
+ [InlineData(true, "true")]
+ [InlineData(false, "false")]
+ public static void Serialize_Bool_Success(bool input, string output)
+ {
+ var options = new JsonSerializerOptions();
+ options.Converters.Add(new JsonBoolNumberConverter());
+ var value = JsonSerializer.Serialize(input, options);
+ Assert.Equal(value, output);
+ }
}
} \ No newline at end of file