mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
Serialize GUID without dashes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using MediaBrowser.Common.Json.Converters;
|
||||
using Xunit;
|
||||
@@ -46,7 +47,15 @@ namespace Jellyfin.Common.Tests.Json
|
||||
[Fact]
|
||||
public void Serialize_EmptyGuid_EmptyGuid()
|
||||
{
|
||||
Assert.Equal($"\"{Guid.Empty}\"", JsonSerializer.Serialize(Guid.Empty, _options));
|
||||
Assert.Equal($"\"{Guid.Empty:N}\"", JsonSerializer.Serialize(Guid.Empty, _options));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Serialize_Valid_NoDash_Success()
|
||||
{
|
||||
var guid = new Guid("531797E9-9457-40E0-88BC-B1D6D38752FA");
|
||||
var str = JsonSerializer.Serialize(guid, _options);
|
||||
Assert.Equal($"\"{guid:N}\"", str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user