Files
pgsql-jellyfin/tests/Jellyfin.Api.Tests/Controllers/DynamicHlsControllerTests.cs
wjones af1152b001 Refactor: standardize namespace and using directive style
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.
2026-02-20 16:26:53 -05:00

50 lines
1.6 KiB
C#

// <copyright file="DynamicHlsControllerTests.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Api.Tests.Controllers
{
using System;
using Jellyfin.Api.Controllers;
using Xunit;
public class DynamicHlsControllerTests
{
[Theory]
[MemberData(nameof(GetSegmentLengths_Success_TestData))]
public void GetSegmentLengths_Success(long runtimeTicks, int segmentlength, double[] expected)
{
var res = DynamicHlsController.GetSegmentLengthsInternal(runtimeTicks, segmentlength);
Assert.Equal(expected.Length, res.Length);
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], res[i]);
}
}
public static TheoryData<long, int, double[]> GetSegmentLengths_Success_TestData()
{
var data = new TheoryData<long, int, double[]>();
data.Add(0, 6, Array.Empty<double>());
data.Add(
TimeSpan.FromSeconds(3).Ticks,
6,
new double[] { 3 });
data.Add(
TimeSpan.FromSeconds(6).Ticks,
6,
new double[] { 6 });
data.Add(
TimeSpan.FromSeconds(3.3333333).Ticks,
6,
new double[] { 3.3333333 });
data.Add(
TimeSpan.FromSeconds(9.3333333).Ticks,
6,
new double[] { 6, 3.3333333 });
return data;
}
}
}