Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Reflection;
|
||||
using StellaOps.Microservice;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Microservice.Tests;
|
||||
|
||||
// Test endpoint classes
|
||||
@@ -23,7 +24,8 @@ public record TestResponse;
|
||||
|
||||
public class EndpointDiscoveryTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void StellaEndpointAttribute_StoresMethodAndPath()
|
||||
{
|
||||
// Arrange & Act
|
||||
@@ -34,7 +36,8 @@ public class EndpointDiscoveryTests
|
||||
Assert.Equal("/api/test", attr.Path);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void StellaEndpointAttribute_NormalizesMethod()
|
||||
{
|
||||
// Arrange & Act
|
||||
@@ -44,7 +47,8 @@ public class EndpointDiscoveryTests
|
||||
Assert.Equal("GET", attr.Method);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void StellaEndpointAttribute_DefaultTimeoutIs30Seconds()
|
||||
{
|
||||
// Arrange & Act
|
||||
@@ -54,7 +58,8 @@ public class EndpointDiscoveryTests
|
||||
Assert.Equal(30, attr.TimeoutSeconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ReflectionDiscovery_FindsEndpointsInCurrentAssembly()
|
||||
{
|
||||
// Arrange
|
||||
@@ -77,7 +82,8 @@ public class EndpointDiscoveryTests
|
||||
Assert.Contains(endpoints, e => e.Method == "POST" && e.Path == "/api/create");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ReflectionDiscovery_SetsServiceNameAndVersion()
|
||||
{
|
||||
// Arrange
|
||||
@@ -100,7 +106,8 @@ public class EndpointDiscoveryTests
|
||||
Assert.Equal("2.0.0", endpoint.Version);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void ReflectionDiscovery_SetsStreamingAndTimeout()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in New Issue
Block a user