Standardizes test conventions and documentation

This commit is contained in:
BinaryAlley committed 2026-08-24 14:20:08 -07:00
1 parent 7aeed04255
commit f42dc709de
190 files changed
+2180 -2814

No files matched your search

@@ -1,6 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.Plugins;
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Application.Fixtures.Common.DataAccess.Entities.Plugins;
using Lumina.DataAccess.Core.UoW;
using Lumina.Domain.SharedKernel.Common.Enums.Plugins;
using Lumina.Presentation.Api.Core.Endpoints.Plugins.GetPlugins;
@@ -9,7 +9,6 @@ using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
@@ -34,6 +33,7 @@ public class GetPluginsEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
};
private readonly List<Guid> _seededPluginIds = [];
private readonly PluginEntityFixture _pluginEntityFixture = new();
/// <summary>
/// Initializes a new instance of the <see cref="GetPluginsEndpointTests"/> class.
@@ -95,37 +95,11 @@ public class GetPluginsEndpointTests : IClassFixture<AuthenticatedLuminaApiFacto
{
using IServiceScope scope = _apiFactory.Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
Guid userId = GetCurrentUserId();
dbContext.Plugins.Add(new PluginEntity
{
Id = pluginId,
Name = name,
Author = "Test Author",
Version = "1.0.0",
Description = "A test plugin.",
LoadStatus = PluginLoadStatus.Loaded,
LoadError = null,
SettingsJson = null,
CreatedBy = userId,
CreatedOnUtc = DateTime.UtcNow,
UpdatedBy = null
});
dbContext.Plugins.Add(_pluginEntityFixture.Create(id: pluginId, name: name, loadStatus: PluginLoadStatus.Loaded, includeSettingsJson: false));
await dbContext.SaveChangesAsync();
_seededPluginIds.Add(pluginId);
}
/// <summary>
/// Gets the Id of the currently authenticated test user.
/// </summary>
/// <returns>The Id of the authenticated test user.</returns>
private Guid GetCurrentUserId()
{
using IServiceScope scope = _apiFactory.Services.CreateScope();
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
UserEntity user = dbContext.Users.First(user => user.Username == _apiFactory.TestUsername);
return user.Id;
}
/// <summary>
/// Removes the seeded plugins and disposes API factory resources.
/// </summary>