#region ========================================================================= USING ===================================================================================== using Bogus; using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; #endregion namespace Lumina.Contracts.Fixtures.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks; /// /// Fixture class for the record. /// [ExcludeFromCodeCoverage] public class DeletedTrackResponseFixture { private readonly Faker _faker = new(); /// /// Creates a random valid . /// /// Optional. The Id of the deleted track. /// Optional. The Id of the media library the deleted track belongs to. /// Optional. The Id of the artist the deleted track belongs to. /// Optional. The name of the artist the deleted track belongs to. /// Optional. The Id of the album the deleted track belongs to. /// Optional. The title of the album the deleted track belongs to. /// Optional. The title of the deleted track. /// Optional. The file system path of the deleted track. /// Optional. The date and time when the track was deleted. /// The created . public DeletedTrackResponse Create( Guid? id = null, Guid? libraryId = null, Guid? artistId = null, string? artistName = null, Guid? albumId = null, string? albumTitle = null, string? title = null, string? path = null, DateTime? deletedOnUtc = null) { return new DeletedTrackResponse( id ?? _faker.Random.Guid(), libraryId ?? _faker.Random.Guid(), artistId ?? _faker.Random.Guid(), artistName ?? _faker.Name.FullName(), albumId ?? _faker.Random.Guid(), albumTitle ?? _faker.Music.Genre(), title ?? _faker.Music.Genre(), path ?? $"/music/tracks/{_faker.Random.Guid()}.flac", deletedOnUtc ?? _faker.Date.Recent().ToUniversalTime()); } /// /// Creates a list of instances with randomized test data. /// /// Number of instances to create. /// List of configured instances. public List CreateMany(int count = 3) { return [.. Enumerable.Range(0, count).Select(_ => Create())]; } }