mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Adds the test suites for the library path templates and centralizes their resolution in the domain service
This commit is contained in:
1 parent
ca4f308b0a
commit
7ed6f05632
52 files changed
+4724
-40
No files matched your search
+35
@@ -0,0 +1,35 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="GetLibraryPathTemplatePartsRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetLibraryPathTemplatePartsRequestFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="GetLibraryPathTemplatePartsRequest"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryType">Optional. The media library type whose available path parts are retrieved.</param>
|
||||
/// <returns>The created <see cref="GetLibraryPathTemplatePartsRequest"/>.</returns>
|
||||
public GetLibraryPathTemplatePartsRequest Create(string? libraryType = null)
|
||||
{
|
||||
return new GetLibraryPathTemplatePartsRequest(libraryType ?? "Music");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="GetLibraryPathTemplatePartsRequest"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<GetLibraryPathTemplatePartsRequest> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Contracts.Requests.MediaLibrary.Management;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="LibraryPathTemplatePartRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class LibraryPathTemplatePartRequestFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="LibraryPathTemplatePartRequest"/>.
|
||||
/// </summary>
|
||||
/// <param name="kind">Optional. The kind of the path part.</param>
|
||||
/// <param name="representation">Optional. The literal text or the value mask of the path part.</param>
|
||||
/// <param name="isOptional">Whether the path part can be absent from the path.</param>
|
||||
/// <returns>The created <see cref="LibraryPathTemplatePartRequest"/>.</returns>
|
||||
public LibraryPathTemplatePartRequest Create(
|
||||
string? kind = null,
|
||||
string? representation = null,
|
||||
bool isOptional = false)
|
||||
{
|
||||
return new LibraryPathTemplatePartRequest(
|
||||
kind ?? "Artist",
|
||||
representation ?? "{0}",
|
||||
isOptional);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="LibraryPathTemplatePartRequest"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<LibraryPathTemplatePartRequest> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user