#region ========================================================================= USING ===================================================================================== using Bogus; using Nemera.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Artists; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; #endregion namespace Nemera.Contracts.Fixtures.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Artists; /// /// Fixture class for the record. /// [ExcludeFromCodeCoverage] public class DeletedArtistResponseFixture { private readonly Faker _faker = new(); /// /// Creates a random valid . /// /// Optional. The Id of the deleted artist. /// Optional. The Id of the media library the deleted artist belongs to. /// Optional. The name of the deleted artist. /// Optional. The date and time when the artist was deleted. /// Optional. The path of the cover image of the deleted artist. /// Whether the cover path should be included, or forced to . /// The created . public DeletedArtistResponse Create( Guid? id = null, Guid? libraryId = null, string? name = null, DateTime? deletedOnUtc = null, string? coverPath = null, bool includeCoverPath = true) { return new DeletedArtistResponse( id ?? _faker.Random.Guid(), libraryId ?? _faker.Random.Guid(), name ?? _faker.Name.FullName(), deletedOnUtc ?? _faker.Date.Recent().ToUniversalTime(), includeCoverPath ? (coverPath ?? $"/covers/{_faker.Random.Guid()}.jpg") : null); } /// /// 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())]; } }