Inlines fixtures instantiation.

This commit is contained in:
BinaryAlley committed 2026-08-15 03:19:51 -07:00
1 parent b648e2f054
commit 59e16d645a
147 files changed
+190 -898

No files matched your search

@@ -25,7 +25,7 @@ namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
[ExcludeFromCodeCoverage]
public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
{
private readonly PasswordHashService _hashService;
private readonly PasswordHashService _hashService = new();
private readonly JsonSerializerOptions _jsonOptions = new()
{
PropertyNameCaseInsensitive = true
@@ -36,14 +36,6 @@ public class AuthenticatedLuminaApiFactory : LuminaApiFactory, IDisposable
/// </summary>
public string? TestUsername { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="AuthenticatedLuminaApiFactory"/> class.
/// </summary>
public AuthenticatedLuminaApiFactory()
{
_hashService = new PasswordHashService();
}
/// <summary>
/// Creates an HTTP client with authentication headers and a test user
/// </summary>
@@ -32,9 +32,9 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
{
private HttpClient _client;
private readonly AuthenticatedLuminaApiFactory _apiFactory;
private readonly PasswordHashService _hashService;
private readonly PasswordHashService _hashService = new();
private readonly ICryptographyService _cryptographyService;
private readonly TotpTokenGenerator _totpTokenGenerator;
private readonly TotpTokenGenerator _totpTokenGenerator = new();
private readonly JsonSerializerOptions _jsonOptions = new()
{
PropertyNameCaseInsensitive = true,
@@ -50,8 +50,6 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
{
_client = apiFactory.CreateClient();
_apiFactory = apiFactory;
_hashService = new PasswordHashService();
_totpTokenGenerator = new TotpTokenGenerator();
_testUsername = $"testuser_{Guid.NewGuid()}";
using IServiceScope scope = apiFactory.Services.CreateScope();
@@ -34,9 +34,9 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
{
private HttpClient _client;
private readonly AuthenticatedLuminaApiFactory _apiFactory;
private readonly PasswordHashService _hashService;
private readonly PasswordHashService _hashService = new();
private readonly ICryptographyService _cryptographyService;
private readonly TotpTokenGenerator _totpTokenGenerator;
private readonly TotpTokenGenerator _totpTokenGenerator = new();
private readonly JsonSerializerOptions _jsonOptions = new()
{
PropertyNameCaseInsensitive = true,
@@ -52,8 +52,6 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
{
_client = apiFactory.CreateClient();
_apiFactory = apiFactory;
_hashService = new PasswordHashService();
_totpTokenGenerator = new TotpTokenGenerator();
_testUsername = $"testuser_{Guid.NewGuid()}";
// get the encryption service with the test key from factory
@@ -39,7 +39,7 @@ public class AddBookEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
new BookJsonConverter()
}
};
private readonly AddBookRequestFixture _requestBookFixture;
private readonly AddBookRequestFixture _requestBookFixture = new();
/// <summary>
/// Initializes a new instance of the <see cref="AddBookEndpointTests"/> class.
@@ -49,7 +49,6 @@ public class AddBookEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>
{
_client = apiFactory.CreateClient();
_apiFactory = apiFactory;
_requestBookFixture = new AddBookRequestFixture();
}
/// <summary>