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