diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-10-04 16:26:43 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-10-04 16:26:43 +0200 |
| commit | d7dc15971ec2fd3598dbc0d60faed1d3aa57d40a (patch) | |
| tree | 198a04460d89d0c5a09069b2878262ec49c16011 | |
| parent | 8535a718b7e9307dfcb2e04d198b0cabbdb15205 (diff) | |
Add roundtrip test
| -rw-r--r-- | tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs b/tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs index aef5b3a7d..d9e66d677 100644 --- a/tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs +++ b/tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs @@ -18,5 +18,15 @@ namespace Jellyfin.Common.Tests.Extensions value = JsonSerializer.Deserialize<Guid>(@"""e9b2dcaa-529c-426e-9433-5e9981f27f2e""", options); Assert.Equal(new Guid("e9b2dcaa-529c-426e-9433-5e9981f27f2e"), value); } + + [Fact] + public static void Roundtrip_Valid_Success() + { + var options = new JsonSerializerOptions(); + options.Converters.Add(new JsonGuidConverter()); + Guid guid = new Guid("a852a27afe324084ae66db579ee3ee18"); + string value = JsonSerializer.Serialize(guid, options); + Assert.Equal(guid, JsonSerializer.Deserialize<Guid>(value, options)); + } } } |
