Fix Windows channel tree ordering
Build and test / test (macos-latest) (push) Canceled after 0s
Build and test / test (ubuntu-24.04) (push) Canceled after 0s
Build and test / test (windows-latest) (push) Canceled after 0s
Build and test / apple-client (push) Canceled after 0s

This commit is contained in:
2026-09-21 19:47:14 +02:00
parent 4aa0aa4fbd
commit 8471eac363
7 changed files with 66 additions and 16 deletions
@@ -8,6 +8,28 @@ namespace VoiceCat.Tests;
public class WindowsManagedClientTests
{
private static readonly AudioConfigInfo DefaultAudio = new(0, false, 48_000, 64_000, 20, 0, true, 10, false, 10, false);
[Fact]
public void ChannelHierarchyUsesServerSortOrderAndKeepsIdsWithDisplayedChannels()
{
ChannelInfo[] channels =
[
new(10, 0, "Zulu", "", false, 0, -10, DefaultAudio),
new(20, 0, "Alpha", "", false, 0, 20, DefaultAudio),
new(11, 10, "Zulu child", "", false, 0, 10, DefaultAudio),
new(12, 10, "Alpha child", "", false, 0, 0, DefaultAudio),
new(30, 0, "Beta", "", false, 0, 20, DefaultAudio),
];
IReadOnlyList<ChannelHierarchyItem> roots = ChannelHierarchy.Build(channels);
Assert.Equal([(10U, "Zulu"), (20U, "Alpha"), (30U, "Beta")],
roots.Select(item => (item.Channel.Id, item.Channel.Name)));
Assert.Equal([(12U, "Alpha child"), (11U, "Zulu child")],
roots[0].Children.Select(item => (item.Channel.Id, item.Channel.Name)));
}
private static async Task Until(Client client, Func<bool> predicate)
{
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(10));