mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 11:11:10 +00:00
Replaces the custom EmptyRequest with explicit API client operations
Removes the Web-specific EmptyRequest record struct and keeps FastEndpoints.EmptyRequest only as an endpoint request DTO. Adds bodyless and response-ignoring client overloads, centralizes request construction and response disposal, and separates stale-session failures from generic 404 responses. Updates the API client stub and tests, including regression coverage for non-empty response bodies, overload selection, and crafted theme asset paths.
This commit is contained in:
1 parent
c1dd08706c
commit
0a86f1a70b
70 files changed
+679
-384
No files matched your search
+3
-3
@@ -40,8 +40,8 @@ public class UpdatePluginSettingsEndpointTests
|
||||
{
|
||||
// Arrange
|
||||
UpdatePluginSettingsRequest request = _updatePluginSettingsRequestFixture.Create();
|
||||
_mockApiHttpClient.PutAsync<Lumina.Presentation.Web.Common.Requests.Common.EmptyRequest, UpdatePluginSettingsRequest>(Arg.Any<string>(), Arg.Any<UpdatePluginSettingsRequest>(), Arg.Any<CancellationToken>())
|
||||
.Returns(new Lumina.Presentation.Web.Common.Requests.Common.EmptyRequest());
|
||||
_mockApiHttpClient.PutIgnoringResponseAsync<UpdatePluginSettingsRequest>(Arg.Any<string>(), Arg.Any<UpdatePluginSettingsRequest>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Task.CompletedTask);
|
||||
|
||||
// Act
|
||||
IResult result = await _sut.ExecuteAsync(request, CancellationToken.None);
|
||||
@@ -49,7 +49,7 @@ public class UpdatePluginSettingsEndpointTests
|
||||
|
||||
// Assert
|
||||
string expectedEndpoint = ApiRoutes.Plugins.UPDATE_PLUGIN_SETTINGS.Replace("{pluginId}", request.PluginId.ToString());
|
||||
await _mockApiHttpClient.Received(1).PutAsync<Lumina.Presentation.Web.Common.Requests.Common.EmptyRequest, UpdatePluginSettingsRequest>(
|
||||
await _mockApiHttpClient.Received(1).PutIgnoringResponseAsync<UpdatePluginSettingsRequest>(
|
||||
expectedEndpoint,
|
||||
Arg.Is<UpdatePluginSettingsRequest>(settings => settings.PluginId == request.PluginId),
|
||||
Arg.Any<CancellationToken>());
|
||||
|
||||
Reference in new issue
Block a user