Adds music stack test coverage and fixes playlist cache and stream error handling

This commit is contained in:
BinaryAlley committed 2026-10-29 15:46:24 +02:00
1 parent 394f6b510c
commit aba803b106
197 files changed
+29081 -34

No files matched your search

@@ -0,0 +1,47 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Application.Core.UsersManagement.Settings.Commands.UpdatePlaybackState;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.UsersManagement.Settings.Commands.UpdatePlaybackState;
/// <summary>
/// Fixture class for the <see cref="UpdatePlaybackStateCommand"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class UpdatePlaybackStateCommandFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid command to update the playback state the player reports for the current user.
/// </summary>
/// <param name="volume">Optional. The last volume the player reported, as a value between 0 and 1.</param>
/// <param name="isMuted">Optional. The last mute state the player reported.</param>
/// <param name="includeVolume">Whether the volume should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsMuted">Whether the mute state should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created <see cref="UpdatePlaybackStateCommand"/>.</returns>
public UpdatePlaybackStateCommand Create(
double? volume = null,
bool? isMuted = null,
bool includeVolume = true,
bool includeIsMuted = true)
{
return new UpdatePlaybackStateCommand(
includeVolume ? volume ?? _faker.Random.Double(0, 1) : null,
includeIsMuted ? isMuted ?? _faker.Random.Bool() : null);
}
/// <summary>
/// Creates a list of <see cref="UpdatePlaybackStateCommand"/> instances.
/// </summary>
/// <param name="count">Number of instances to create.</param>
/// <returns>List of configured <see cref="UpdatePlaybackStateCommand"/> instances.</returns>
public List<UpdatePlaybackStateCommand> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.UsersManagement.Settings.Queries.GetPlaybackState;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.UsersManagement.Settings.Queries.GetPlaybackState;
/// <summary>
/// Fixture class for the <see cref="GetPlaybackStateQuery"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetPlaybackStateQueryFixture
{
/// <summary>
/// Creates a new <see cref="GetPlaybackStateQuery"/> instance.
/// </summary>
/// <returns>The created <see cref="GetPlaybackStateQuery"/>.</returns>
public GetPlaybackStateQuery Create()
{
return new GetPlaybackStateQuery();
}
/// <summary>
/// Creates a list of <see cref="GetPlaybackStateQuery"/> instances.
/// </summary>
/// <param name="count">Number of instances to create.</param>
/// <returns>List of configured <see cref="GetPlaybackStateQuery"/> instances.</returns>
public List<GetPlaybackStateQuery> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}