mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Add roundtrip test
This commit is contained in:
parent
8535a718b7
commit
d7dc15971e
1 changed files with 10 additions and 0 deletions
|
@ -18,5 +18,15 @@ namespace Jellyfin.Common.Tests.Extensions
|
||||||
value = JsonSerializer.Deserialize<Guid>(@"""e9b2dcaa-529c-426e-9433-5e9981f27f2e""", options);
|
value = JsonSerializer.Deserialize<Guid>(@"""e9b2dcaa-529c-426e-9433-5e9981f27f2e""", options);
|
||||||
Assert.Equal(new Guid("e9b2dcaa-529c-426e-9433-5e9981f27f2e"), value);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue