diff options
| author | crobibero <cody@robibe.ro> | 2020-12-08 07:18:25 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-08 07:18:25 -0700 |
| commit | 26e5aacb9096c448d6e545b1a2713972994f6418 (patch) | |
| tree | 9d3a20ef4bcac2474ebcb84be932b5c9ec5bf2a7 /tests | |
| parent | 80ff564143b0745cba4b01b5378df6415f4072af (diff) | |
Fix JsonConverter recursion
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Common.Tests/Json/JsonBoolNumberTests.cs | 11 |
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 |
