Merge branch 'refactor/standardize-test-fixtures-and-docs' into feature/add-artwork-provider-and-metadata-aggregation

This commit is contained in:
BinaryAlley committed 2026-08-24 22:56:22 -07:00
commit 4ff184d8a5
388 files changed
+13829 -2814

No files matched your search

@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.Management.Commands.CancelLibrariesScan;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.MediaLibrary.Management.Commands.CancelLibrariesScan;
/// <summary>
/// Fixture class for the <see cref="CancelLibrariesScanCommand"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class CancelLibrariesScanCommandFixture
{
/// <summary>
/// Creates a <see cref="CancelLibrariesScanCommand"/>.
/// </summary>
/// <returns>The created <see cref="CancelLibrariesScanCommand"/>.</returns>
public CancelLibrariesScanCommand Create()
{
return new CancelLibrariesScanCommand();
}
/// <summary>
/// Creates a list of <see cref="CancelLibrariesScanCommand"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<CancelLibrariesScanCommand> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.Management.Commands.ScanLibraries;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.MediaLibrary.Management.Commands.ScanLibraries;
/// <summary>
/// Fixture class for the <see cref="ScanLibrariesCommand"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class ScanLibrariesCommandFixture
{
/// <summary>
/// Creates a <see cref="ScanLibrariesCommand"/>.
/// </summary>
/// <returns>The created <see cref="ScanLibrariesCommand"/>.</returns>
public ScanLibrariesCommand Create()
{
return new ScanLibrariesCommand();
}
/// <summary>
/// Creates a list of <see cref="ScanLibrariesCommand"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<ScanLibrariesCommand> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.Management.Queries.GetEnabledLibraries;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.MediaLibrary.Management.Queries.GetEnabledLibraries;
/// <summary>
/// Fixture class for the <see cref="GetEnabledLibrariesQuery"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetEnabledLibrariesQueryFixture
{
/// <summary>
/// Creates a <see cref="GetEnabledLibrariesQuery"/>.
/// </summary>
/// <returns>The created <see cref="GetEnabledLibrariesQuery"/>.</returns>
public GetEnabledLibrariesQuery Create()
{
return new GetEnabledLibrariesQuery();
}
/// <summary>
/// Creates a list of <see cref="GetEnabledLibrariesQuery"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<GetEnabledLibrariesQuery> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.Management.Queries.GetLibraries;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.MediaLibrary.Management.Queries.GetLibraries;
/// <summary>
/// Fixture class for the <see cref="GetLibrariesQuery"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetLibrariesQueryFixture
{
/// <summary>
/// Creates a <see cref="GetLibrariesQuery"/>.
/// </summary>
/// <returns>The created <see cref="GetLibrariesQuery"/>.</returns>
public GetLibrariesQuery Create()
{
return new GetLibrariesQuery();
}
/// <summary>
/// Creates a list of <see cref="GetLibrariesQuery"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<GetLibrariesQuery> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,34 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Core.MediaLibrary.Management.Queries.GetRunningLibraryScans;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Application.Fixtures.Core.MediaLibrary.Management.Queries.GetRunningLibraryScans;
/// <summary>
/// Fixture class for the <see cref="GetRunningLibraryScansQuery"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public class GetRunningLibraryScansQueryFixture
{
/// <summary>
/// Creates a <see cref="GetRunningLibraryScansQuery"/>.
/// </summary>
/// <returns>The created <see cref="GetRunningLibraryScansQuery"/>.</returns>
public GetRunningLibraryScansQuery Create()
{
return new GetRunningLibraryScansQuery();
}
/// <summary>
/// Creates a list of <see cref="GetRunningLibraryScansQuery"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<GetRunningLibraryScansQuery> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -28,20 +28,22 @@ public class GetBooksQueryFixture
/// <param name="searchTerm">Optional. The search term used to filter results.</param>
/// <param name="sortBy">Optional. The name of the field by which to sort the results.</param>
/// <param name="sortOrder">Optional. The direction in which to sort the results.</param>
/// <param name="includePaginationData">Whether the query should include pagination data or not.</param>
/// <returns>The created query to get books.</returns>
public GetBooksQuery Create(
Guid? libraryId = null,
PaginationDataDto? paginationData = null,
string? searchTerm = null,
string? sortBy = null,
SortOrder? sortOrder = null)
SortOrder? sortOrder = null,
bool includePaginationData = true)
{
return new GetBooksQuery(
paginationData ?? new PaginationDataDto
includePaginationData ? paginationData ?? new PaginationDataDto
{
CurrentPage = _faker.Random.Number(1, 100),
PerPage = _faker.Random.Number(1, 200)
},
} : null,
new LibraryFilterDto
{
LibraryId = libraryId ?? _faker.Random.Guid(),
@@ -27,31 +27,33 @@ public class GetBooksLiteQueryFixture
/// <param name="paginationData">Optional. The pagination data of the query.</param>
/// <param name="searchTerm">Optional. The search term used to filter results.</param>
/// <param name="filterAlphaKey">Optional. The alpha key used to filter the results by the first character of their title, for the alpha picker.</param>
/// <param name="ignoreThePrefixForAlphaPicker">Optional. Whether the leading "The " prefix of a title should be ignored when computing the alpha key, or not.</param>
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Optional. Whether the leading "The " prefix of a title should be ignored when computing the alpha key, or not.</param>
/// <param name="sortBy">Optional. The name of the field by which to sort the results.</param>
/// <param name="sortOrder">Optional. The direction in which to sort the results.</param>
/// <param name="includePaginationData">Whether the query should include pagination data or not.</param>
/// <returns>The created query to get the lightweight details of books.</returns>
public GetBooksLiteQuery Create(
Guid? libraryId = null,
PaginationDataDto? paginationData = null,
string? searchTerm = null,
string? filterAlphaKey = null,
bool ignoreThePrefixForAlphaPicker = false,
bool shouldIgnoreThePrefixForAlphaPicker = false,
string? sortBy = null,
SortOrder? sortOrder = null)
SortOrder? sortOrder = null,
bool includePaginationData = true)
{
return new GetBooksLiteQuery(
paginationData ?? new PaginationDataDto
includePaginationData ? paginationData ?? new PaginationDataDto
{
CurrentPage = _faker.Random.Number(1, 100),
PerPage = _faker.Random.Number(1, 200)
},
} : null,
new LibraryFilterDto
{
LibraryId = libraryId ?? _faker.Random.Guid(),
SearchTerm = searchTerm,
FilterAlphaKey = filterAlphaKey,
IgnoreThePrefixForAlphaPicker = ignoreThePrefixForAlphaPicker
ShouldIgnoreThePrefixForAlphaPicker = shouldIgnoreThePrefixForAlphaPicker
},
sortBy,
sortOrder ?? _faker.PickRandom<SortOrder>()