mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Merge branch 'refactor/standardize-test-fixtures-and-docs' into feature/add-artwork-provider-and-metadata-aggregation
This commit is contained in:
commit
4ff184d8a5
388 files changed
+13829
-2814
No files matched your search
+34
@@ -0,0 +1,34 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Admin.Authorization.Permissions.Queries.GetPermissions;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Admin.Authorization.Permissions.Queries.GetPermissions;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="GetPermissionsQuery"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetPermissionsQueryFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid query to get permissions.
|
||||
/// </summary>
|
||||
/// <returns>The created query.</returns>
|
||||
public GetPermissionsQuery Create()
|
||||
{
|
||||
return new GetPermissionsQuery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="GetPermissionsQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<GetPermissionsQuery> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Maintenance.ApplicationSetup.Queries.CheckInitialization;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Maintenance.ApplicationSetup.Queries.CheckInitialization;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="CheckInitializationQuery"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class CheckInitializationQueryFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a <see cref="CheckInitializationQuery"/>.
|
||||
/// </summary>
|
||||
/// <returns>The created <see cref="CheckInitializationQuery"/>.</returns>
|
||||
public CheckInitializationQuery Create()
|
||||
{
|
||||
return new CheckInitializationQuery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="CheckInitializationQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<CheckInitializationQuery> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+34
@@ -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())];
|
||||
}
|
||||
}
|
||||
+34
@@ -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())];
|
||||
}
|
||||
}
|
||||
+34
@@ -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())];
|
||||
}
|
||||
}
|
||||
+34
@@ -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())];
|
||||
}
|
||||
}
|
||||
+34
@@ -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())];
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -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(),
|
||||
|
||||
+8
-6
@@ -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>()
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.Plugins.Queries.GetPlugins;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.Plugins.Queries.GetPlugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="GetPluginsQuery"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetPluginsQueryFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a <see cref="GetPluginsQuery"/>.
|
||||
/// </summary>
|
||||
/// <returns>The created <see cref="GetPluginsQuery"/>.</returns>
|
||||
public GetPluginsQuery Create()
|
||||
{
|
||||
return new GetPluginsQuery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="GetPluginsQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<GetPluginsQuery> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Core.UsersManagement.Settings.Queries.GetUserSettings;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Fixtures.Core.UsersManagement.Settings.Queries.GetUserSettings;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="GetUserSettingsQuery"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetUserSettingsQueryFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid query to get the settings of the current user.
|
||||
/// </summary>
|
||||
/// <returns>The created query.</returns>
|
||||
public GetUserSettingsQuery Create()
|
||||
{
|
||||
return new GetUserSettingsQuery();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="GetUserSettingsQuery"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<GetUserSettingsQuery> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user