Refactor code structure and optimize performance across multiple modules

This commit is contained in:
StellaOps Bot
2025-12-26 20:03:22 +02:00
parent c786faae84
commit b4fc66feb6
3353 changed files with 88254 additions and 1590657 deletions

View File

@@ -11,6 +11,8 @@ using System.Security.Cryptography;
using System.Text;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Scanner.WebService.Tests;
/// <summary>
@@ -30,7 +32,8 @@ public sealed class IdempotencyMiddlewareTests
config["Scanner:Idempotency:Window"] = "24:00:00";
});
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task PostRequest_WithContentDigest_ReturnsIdempotencyKey()
{
// Arrange
@@ -50,7 +53,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task DuplicateRequest_WithSameContentDigest_ReturnsCachedResponse()
{
// Arrange
@@ -75,7 +79,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response2.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task DifferentRequests_WithDifferentDigests_AreProcessedSeparately()
{
// Arrange
@@ -100,7 +105,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response2.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task GetRequest_BypassesIdempotencyMiddleware()
{
// Arrange
@@ -114,7 +120,8 @@ public sealed class IdempotencyMiddlewareTests
Assert.NotEqual(HttpStatusCode.InternalServerError, response.StatusCode);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task PostRequest_WithoutContentDigest_ComputesDigest()
{
// Arrange