Explorar o código

Add nullable guid test

crobibero %!s(int64=4) %!d(string=hai) anos
pai
achega
681a0f3e75
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs

+ 8 - 0
tests/Jellyfin.Common.Tests/Json/JsonGuidConverterTests.cs

@@ -57,5 +57,13 @@ namespace Jellyfin.Common.Tests.Json
             var str = JsonSerializer.Serialize(guid, _options);
             Assert.Equal($"\"{guid:N}\"", str);
         }
+
+        [Fact]
+        public void Serialize_Nullable_Success()
+        {
+            Guid? guid = new Guid("531797E9-9457-40E0-88BC-B1D6D38752FA");
+            var str = JsonSerializer.Serialize(guid, _options);
+            Assert.Equal($"\"{guid:N}\"", str);
+        }
     }
 }