Hardens test assertions and adds missing test coverage.

This commit is contained in:
BinaryAlley committed 2026-08-18 08:28:16 -07:00
1 parent 6b86fd5805
commit 1189bbaf36
489 files changed
+39982 -512

No files matched your search

@@ -0,0 +1,48 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.Responses.Authentication;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
#endregion
namespace Lumina.Contracts.Fixtures.Core.Responses.Authentication;
/// <summary>
/// Fixture class for the <see cref="RegistrationResponse"/> record.
/// </summary>
[ExcludeFromCodeCoverage]
public class RegistrationResponseFixture
{
private readonly Faker _faker = new();
/// <summary>
/// Creates a random valid <see cref="RegistrationResponse"/>.
/// </summary>
/// <param name="id">Optional. The Id of the registered user.</param>
/// <param name="username">Optional. The username of the registered user.</param>
/// <param name="totpSecret">Optional. The TOTP secret used for two-factor authentication.</param>
/// <returns>The created <see cref="RegistrationResponse"/>.</returns>
public RegistrationResponse Create(
Guid? id = null,
string? username = null,
string? totpSecret = null)
{
return new RegistrationResponse(
id ?? Guid.NewGuid(),
username ?? _faker.Internet.UserName(),
totpSecret ?? _faker.Random.AlphaNumeric(16)
);
}
/// <summary>
/// Creates a list of <see cref="RegistrationResponse"/>.
/// </summary>
/// <param name="count">The number of elements to create.</param>
/// <returns>The created list.</returns>
public List<RegistrationResponse> CreateMany(int count = 3)
{
return [.. Enumerable.Range(0, count).Select(_ => Create())];
}
}