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:
2026-02-22 10:31:23 -05:00
parent d5522c6fb3
commit dbeec2e9f0
17 changed files with 302 additions and 245 deletions
@@ -26,7 +26,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
[InlineData("false", "false")]
public void Deserialize_String_Valid_Success(string input, string output)
{
var deserialized = JsonSerializer.Deserialize<string>(input, _jsonSerializerOptions);
string? deserialized = JsonSerializer.Deserialize<string>(input, this._jsonSerializerOptions);
Assert.Equal(deserialized, output);
}
@@ -35,7 +35,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
{
const string? input = "123";
const int output = 123;
var deserialized = JsonSerializer.Deserialize<int>(input, _jsonSerializerOptions);
int deserialized = JsonSerializer.Deserialize<int>(input, this._jsonSerializerOptions);
Assert.Equal(output, deserialized);
}
}