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,15 +1,12 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Exceptions;
using Lumina.Presentation.Web.Core.Endpoints.Plugins.GetPlugins;
using Lumina.Presentation.Web.Fixtures.Common.DTO.Common;
using Lumina.Presentation.Web.Fixtures.Common.TestHelpers;
using Lumina.Presentation.Web.SecurityTests.Common.Setup;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.GetPlugins;
@@ -21,6 +18,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.GetPlugin
public class GetPluginsEndpointTests : IClassFixture<LuminaWebFactory>
{
private readonly LuminaWebFactory _apiFactory;
private readonly ProblemDetailsDtoFixture _problemDetailsDtoFixture = new();
/// <summary>
/// Initializes a new instance of the <see cref="GetPluginsEndpointTests"/> class.
@@ -55,7 +53,7 @@ public class GetPluginsEndpointTests : IClassFixture<LuminaWebFactory>
// Arrange
_apiFactory.ApiClientStub.Reset();
_apiFactory.ApiClientStub.RegisterGetException("plugins", new ApiException(
new ProblemDetailsDto { Title = "General.Failure", Detail = "PluginNotFound" },
_problemDetailsDtoFixture.Create(title: "General.Failure", detail: "PluginNotFound"),
HttpStatusCode.NotFound));
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
HttpRequestMessage getRequest = new(HttpMethod.Get, "/en-us/admin/manage-plugins/api-get-plugins");
@@ -1,16 +1,13 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Exceptions;
using Lumina.Presentation.Web.Core.Endpoints.Plugins.InstallPlugin;
using Lumina.Presentation.Web.Fixtures.Common.DTO.Common;
using Lumina.Presentation.Web.Fixtures.Common.TestHelpers;
using Lumina.Presentation.Web.SecurityTests.Common.Setup;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.InstallPlugin;
@@ -22,6 +19,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.InstallPl
public class InstallPluginEndpointTests : IClassFixture<LuminaWebFactory>
{
private readonly LuminaWebFactory _apiFactory;
private readonly ProblemDetailsDtoFixture _problemDetailsDtoFixture = new();
/// <summary>
/// Initializes a new instance of the <see cref="InstallPluginEndpointTests"/> class.
@@ -101,7 +99,7 @@ public class InstallPluginEndpointTests : IClassFixture<LuminaWebFactory>
// Arrange
_apiFactory.ApiClientStub.Reset();
_apiFactory.ApiClientStub.RegisterPostException("plugins", new ApiException(
new ProblemDetailsDto { Title = "General.Failure", Detail = "PluginArchiveNotReadable" },
_problemDetailsDtoFixture.Create(title: "General.Failure", detail: "PluginArchiveNotReadable"),
HttpStatusCode.Forbidden));
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
HttpRequestMessage installRequest = new(HttpMethod.Post, "/en-us/admin/manage-plugins/api-install-plugin")
@@ -1,18 +1,15 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.DTO.Common;
using Lumina.Presentation.Web.Common.Exceptions;
using Lumina.Presentation.Web.Common.Requests.Plugins;
using Lumina.Presentation.Web.Core.Endpoints.Plugins.UpdatePluginSettings;
using Lumina.Presentation.Web.Fixtures.Common.DTO.Common;
using Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
using Lumina.Presentation.Web.Fixtures.Common.TestHelpers;
using Lumina.Presentation.Web.SecurityTests.Common.Setup;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.UpdatePluginSettings;
@@ -24,6 +21,7 @@ namespace Lumina.Presentation.Web.SecurityTests.Core.Endpoints.Plugins.UpdatePlu
public class UpdatePluginSettingsEndpointTests : IClassFixture<LuminaWebFactory>
{
private readonly LuminaWebFactory _apiFactory;
private readonly ProblemDetailsDtoFixture _problemDetailsDtoFixture = new();
private readonly UpdatePluginSettingsRequestFixture _updatePluginSettingsRequestFixture = new();
/// <summary>
@@ -89,7 +87,7 @@ public class UpdatePluginSettingsEndpointTests : IClassFixture<LuminaWebFactory>
UpdatePluginSettingsRequest request = _updatePluginSettingsRequestFixture.Create();
string endpoint = $"plugins/{request.PluginId}/settings";
_apiFactory.ApiClientStub.RegisterPutException(endpoint, new ApiException(
new ProblemDetailsDto { Title = "General.Failure", Detail = "PluginNotFound" },
_problemDetailsDtoFixture.Create(title: "General.Failure", detail: "PluginNotFound"),
HttpStatusCode.NotFound));
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
HttpRequestMessage updateRequest = new(HttpMethod.Put, "/en-us/admin/manage-plugins/api-update-plugin-settings")