// // Copyright (c) PlaceholderCompany. All rights reserved. // namespace Jellyfin.Extensions.Tests.Json.Converters { using System.Text.Json; using Jellyfin.Extensions.Json.Converters; using MediaBrowser.Model.Session; using Xunit; public class JsonFlagEnumTests { private readonly JsonSerializerOptions _jsonOptions = new() { Converters = { new JsonFlagEnumConverter(), }, }; [Theory] [InlineData(TranscodeReason.AudioIsExternal | TranscodeReason.ContainerNotSupported, "[\"ContainerNotSupported\",\"AudioIsExternal\"]")] [InlineData(TranscodeReason.AudioIsExternal | TranscodeReason.ContainerNotSupported | TranscodeReason.VideoBitDepthNotSupported, "[\"ContainerNotSupported\",\"AudioIsExternal\",\"VideoBitDepthNotSupported\"]")] [InlineData((TranscodeReason)0, "[]")] public void Serialize_Transcode_Reason(TranscodeReason transcodeReason, string output) { string result = JsonSerializer.Serialize(transcodeReason, this._jsonOptions); Assert.Equal(output, result); } } }