Adds test fixtures and endpoint test coverage

This commit is contained in:
BinaryAlley committed 2026-08-24 14:19:45 -07:00
1 parent c82fadc7a2
commit 7aeed04255
198 files changed
+11649

No files matched your search

@@ -0,0 +1,40 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.FileSystemManagement.FileSystem;
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.FileSystemManagement.FileSystem;
/// <summary>
/// Fixture class for the <see cref="FileSystemTypeResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class FileSystemTypeResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="FileSystemTypeResponse"/>.
/// </summary>
/// <param name="platformType">Optional. The type of the file system platform.</param>
/// <returns>The created <see cref="FileSystemTypeResponse"/>.</returns>
public FileSystemTypeResponse Create(
PlatformType? platformType = null)
{
return new FileSystemTypeResponse(platformType ?? _faker.PickRandom<PlatformType>());
}
/// <summary>
/// Creates a list of <see cref="FileSystemTypeResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<FileSystemTypeResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,39 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.FileSystemManagement.Path;
/// <summary>
/// Fixture class for the <see cref="PathExistsResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class PathExistsResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="PathExistsResponse"/>.
/// </summary>
/// <param name="exists">Optional. Whether the path exists.</param>
/// <returns>The created <see cref="PathExistsResponse"/>.</returns>
public PathExistsResponse Create(
bool? exists = null)
{
return new PathExistsResponse(exists ?? _faker.Random.Bool());
}
/// <summary>
/// Creates a list of <see cref="PathExistsResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<PathExistsResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}
@@ -0,0 +1,39 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.FileSystemManagement.Path;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.FileSystemManagement.Path;
/// <summary>
/// Fixture class for the <see cref="PathValidResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class PathValidResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="PathValidResponse"/>.
/// </summary>
/// <param name="isValid">Optional. Whether the path is valid.</param>
/// <returns>The created <see cref="PathValidResponse"/>.</returns>
public PathValidResponse Create(
bool? isValid = null)
{
return new PathValidResponse(isValid ?? _faker.Random.Bool());
}
/// <summary>
/// Creates a list of <see cref="PathValidResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<PathValidResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}