mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Adds favorites and aligns playlist and favorite pagination
This commit is contained in:
1 parent
2e9f7d8496
commit
525ac1348d
193 files changed
+10944
-643
No files matched your search
-55
@@ -1,55 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PaginatedMusicAlbumLiteDto"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PaginatedMusicAlbumLiteDtoFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
private readonly MusicAlbumLiteDtoFixture _musicAlbumLiteDtoFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="PaginatedMusicAlbumLiteDto"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="data">Optional. The collection of lightweight album elements.</param>
|
||||
/// <param name="currentPage">Optional. The current page number in the paginated collection.</param>
|
||||
/// <param name="perPage">Optional. The number of items to include per page.</param>
|
||||
/// <param name="count">Optional. The total number of elements available in the result set.</param>
|
||||
/// <param name="numberOfPages">Optional. The total number of pages available.</param>
|
||||
/// <returns>A configured <see cref="PaginatedMusicAlbumLiteDto"/> instance.</returns>
|
||||
public PaginatedMusicAlbumLiteDto Create(
|
||||
IReadOnlyList<MusicAlbumLiteDto>? data = null,
|
||||
int? currentPage = null,
|
||||
int? perPage = null,
|
||||
int? count = null,
|
||||
int? numberOfPages = null)
|
||||
{
|
||||
return new PaginatedMusicAlbumLiteDto
|
||||
{
|
||||
Data = data ?? [.. _musicAlbumLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))],
|
||||
CurrentPage = currentPage ?? _faker.Random.Int(1, 10),
|
||||
PerPage = perPage ?? _faker.Random.Int(1, 100),
|
||||
Count = count ?? _faker.Random.Int(0, 1000),
|
||||
NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates multiple <see cref="PaginatedMusicAlbumLiteDto"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="PaginatedMusicAlbumLiteDto"/> instances.</returns>
|
||||
public List<PaginatedMusicAlbumLiteDto> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PaginatedMusicArtistLiteDto"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PaginatedMusicArtistLiteDtoFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
private readonly MusicArtistLiteDtoFixture _musicArtistLiteDtoFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="PaginatedMusicArtistLiteDto"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="data">Optional. The collection of lightweight artist elements.</param>
|
||||
/// <param name="currentPage">Optional. The current page number in the paginated collection.</param>
|
||||
/// <param name="perPage">Optional. The number of items to include per page.</param>
|
||||
/// <param name="count">Optional. The total number of elements available in the result set.</param>
|
||||
/// <param name="numberOfPages">Optional. The total number of pages available.</param>
|
||||
/// <returns>A configured <see cref="PaginatedMusicArtistLiteDto"/> instance.</returns>
|
||||
public PaginatedMusicArtistLiteDto Create(
|
||||
IReadOnlyList<MusicArtistLiteDto>? data = null,
|
||||
int? currentPage = null,
|
||||
int? perPage = null,
|
||||
int? count = null,
|
||||
int? numberOfPages = null)
|
||||
{
|
||||
return new PaginatedMusicArtistLiteDto
|
||||
{
|
||||
Data = data ?? [.. _musicArtistLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))],
|
||||
CurrentPage = currentPage ?? _faker.Random.Int(1, 10),
|
||||
PerPage = perPage ?? _faker.Random.Int(1, 100),
|
||||
Count = count ?? _faker.Random.Int(0, 1000),
|
||||
NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates multiple <see cref="PaginatedMusicArtistLiteDto"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="PaginatedMusicArtistLiteDto"/> instances.</returns>
|
||||
public List<PaginatedMusicArtistLiteDto> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Presentation.Web.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.DTO.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PaginatedMusicTrackLiteDto"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PaginatedMusicTrackLiteDtoFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
private readonly MusicTrackLiteDtoFixture _musicTrackLiteDtoFixture = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="PaginatedMusicTrackLiteDto"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="data">Optional. The collection of lightweight track elements.</param>
|
||||
/// <param name="currentPage">Optional. The current page number in the paginated collection.</param>
|
||||
/// <param name="perPage">Optional. The number of items to include per page.</param>
|
||||
/// <param name="count">Optional. The total number of elements available in the result set.</param>
|
||||
/// <param name="numberOfPages">Optional. The total number of pages available.</param>
|
||||
/// <returns>A configured <see cref="PaginatedMusicTrackLiteDto"/> instance.</returns>
|
||||
public PaginatedMusicTrackLiteDto Create(
|
||||
IReadOnlyList<MusicTrackLiteDto>? data = null,
|
||||
int? currentPage = null,
|
||||
int? perPage = null,
|
||||
int? count = null,
|
||||
int? numberOfPages = null)
|
||||
{
|
||||
return new PaginatedMusicTrackLiteDto
|
||||
{
|
||||
Data = data ?? [.. _musicTrackLiteDtoFixture.CreateMany(_faker.Random.Number(1, 3))],
|
||||
CurrentPage = currentPage ?? _faker.Random.Int(1, 10),
|
||||
PerPage = perPage ?? _faker.Random.Int(1, 100),
|
||||
Count = count ?? _faker.Random.Int(0, 1000),
|
||||
NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates multiple <see cref="PaginatedMusicTrackLiteDto"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="PaginatedMusicTrackLiteDto"/> instances.</returns>
|
||||
public List<PaginatedMusicTrackLiteDto> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+19
-20
@@ -1,53 +1,52 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Presentation.Web.Common.DTO.Libraries;
|
||||
using Lumina.Presentation.Web.Common.DTO.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Libraries;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.DTO.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PaginatedBookLiteDto"/> class.
|
||||
/// Fixture class for the <see cref="PaginatedDto{T}"/> class.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the elements of the page.</typeparam>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PaginatedBookLiteDtoFixture
|
||||
public class PaginatedDtoFixture<T>
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="PaginatedBookLiteDto"/> instance with randomized test data.
|
||||
/// Creates a new <see cref="PaginatedDto{T}"/> instance with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="data">Optional collection of lightweight book elements.</param>
|
||||
/// <param name="data">Optional collection of elements of the page.</param>
|
||||
/// <param name="currentPage">Optional current page number in a paginated collection.</param>
|
||||
/// <param name="perPage">Optional number of items to include per page in paginated results.</param>
|
||||
/// <param name="count">Optional total number of elements available in the paginated result set.</param>
|
||||
/// <param name="numberOfPages">Optional total number of pages based on the elements available and per page.</param>
|
||||
/// <returns>A configured <see cref="PaginatedBookLiteDto"/> instance.</returns>
|
||||
public PaginatedBookLiteDto Create(
|
||||
IReadOnlyList<BookLiteDto>? data = null,
|
||||
/// <returns>A configured <see cref="PaginatedDto{T}"/> instance.</returns>
|
||||
public PaginatedDto<T> Create(
|
||||
IReadOnlyList<T>? data = null,
|
||||
int? currentPage = null,
|
||||
int? perPage = null,
|
||||
int? count = null,
|
||||
int? numberOfPages = null)
|
||||
{
|
||||
return new PaginatedBookLiteDto
|
||||
{
|
||||
Data = data ?? [],
|
||||
CurrentPage = currentPage ?? _faker.Random.Int(1, 10),
|
||||
PerPage = perPage ?? _faker.Random.Int(1, 100),
|
||||
Count = count ?? _faker.Random.Int(0, 1000),
|
||||
NumberOfPages = numberOfPages ?? _faker.Random.Int(1, 100)
|
||||
};
|
||||
return new PaginatedDto<T>(
|
||||
Data: data is null ? [] : [.. data],
|
||||
CurrentPage: currentPage ?? _faker.Random.Int(1, 10),
|
||||
PerPage: perPage ?? _faker.Random.Int(1, 100),
|
||||
Count: count ?? _faker.Random.Int(0, 1000),
|
||||
NumberOfPages: numberOfPages ?? _faker.Random.Int(1, 100));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates multiple <see cref="PaginatedBookLiteDto"/> instances with randomized test data.
|
||||
/// Creates multiple <see cref="PaginatedDto{T}"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="PaginatedBookLiteDto"/> instances.</returns>
|
||||
public List<PaginatedBookLiteDto> CreateMany(int count = 3)
|
||||
/// <returns>List of configured <see cref="PaginatedDto{T}"/> instances.</returns>
|
||||
public List<PaginatedDto<T>> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
Reference in new issue
Block a user