af1152b001
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
// <copyright file="JsonVersionConverterTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Extensions.Tests.Json.Converters
|
|
{
|
|
using System;
|
|
using System.Text.Json;
|
|
using Jellyfin.Extensions.Json.Converters;
|
|
using Xunit;
|
|
|
|
public class JsonVersionConverterTests
|
|
{
|
|
private readonly JsonSerializerOptions _options;
|
|
|
|
public JsonVersionConverterTests()
|
|
{
|
|
_options = new JsonSerializerOptions();
|
|
_options.Converters.Add(new JsonVersionConverter());
|
|
}
|
|
|
|
[Fact]
|
|
public void Deserialize_Version_Success()
|
|
{
|
|
var input = "\"1.025.222\"";
|
|
var output = new Version(1, 25, 222);
|
|
var deserializedInput = JsonSerializer.Deserialize<Version>(input, _options);
|
|
Assert.Equal(output, deserializedInput);
|
|
}
|
|
|
|
[Fact]
|
|
public void Serialize_Version_Success()
|
|
{
|
|
var input = new Version(1, 09, 59);
|
|
var output = "\"1.9.59\"";
|
|
var serializedInput = JsonSerializer.Serialize(input, _options);
|
|
Assert.Equal(output, serializedInput);
|
|
}
|
|
}
|
|
}
|