Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user