Refactor and modernize JSON converter test code
Refactor test code in Jellyfin.Extensions.Tests for clarity and consistency: - Use explicit object initializers and collection expressions - Standardize field naming and use of this. - Add/improve XML doc comments for test methods - Use new(...) syntax for Guid/Version instantiation - Convert file-scoped to block-scoped namespaces in key tests - Nest test classes and use instance methods in enum tests - Enable XML docs and suppress select warnings in csproj - No changes to test or converter logic; style and maintainability only
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
|
||||
[InlineData(@"{ ""Value"": ""false"" }", false)]
|
||||
public void Deserialize_String_Valid_Success(string input, bool output)
|
||||
{
|
||||
TestStruct s = JsonSerializer.Deserialize<TestStruct>(input, _jsonOptions);
|
||||
TestStruct s = JsonSerializer.Deserialize<TestStruct>(input, this._jsonOptions);
|
||||
Assert.Equal(s.Value, output);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
|
||||
[InlineData(false, "false")]
|
||||
public void Serialize_Bool_Success(bool input, string output)
|
||||
{
|
||||
string value = JsonSerializer.Serialize(input, _jsonOptions);
|
||||
string value = JsonSerializer.Serialize(input, this._jsonOptions);
|
||||
Assert.Equal(value, output);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user