Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -61,7 +61,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Basic Generation Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithTypedEndpoint_GeneratesSource()
|
||||
{
|
||||
// Arrange
|
||||
@@ -98,7 +99,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("GET");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithRawEndpoint_GeneratesSource()
|
||||
{
|
||||
// Arrange
|
||||
@@ -131,7 +133,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("/raw/upload");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithMultipleEndpoints_GeneratesAll()
|
||||
{
|
||||
// Arrange
|
||||
@@ -175,7 +178,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("/endpoint2");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithNoEndpoints_GeneratesNothing()
|
||||
{
|
||||
// Arrange
|
||||
@@ -201,7 +205,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Attribute Property Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithTimeout_IncludesTimeoutInGeneration()
|
||||
{
|
||||
// Arrange
|
||||
@@ -232,7 +237,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("FromSeconds(120)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithStreaming_IncludesStreamingFlag()
|
||||
{
|
||||
// Arrange
|
||||
@@ -260,7 +266,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("SupportsStreaming = true");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithRequiredClaims_IncludesClaims()
|
||||
{
|
||||
// Arrange
|
||||
@@ -297,7 +304,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region HTTP Method Tests
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Theory]
|
||||
[InlineData("GET")]
|
||||
[InlineData("POST")]
|
||||
[InlineData("PUT")]
|
||||
@@ -337,7 +345,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Error Cases Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithAbstractClass_ReportsDiagnostic()
|
||||
{
|
||||
// Arrange
|
||||
@@ -368,7 +377,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithMissingInterface_ReportsDiagnostic()
|
||||
{
|
||||
// Arrange
|
||||
@@ -399,7 +409,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Generated Provider Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_GeneratesProviderClass()
|
||||
{
|
||||
// Arrange
|
||||
@@ -439,7 +450,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Namespace Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithGlobalNamespace_HandlesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
@@ -468,7 +480,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
generatedSource.Should().Contain("GlobalEndpoint");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithNestedNamespace_HandlesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
@@ -504,7 +517,8 @@ public sealed class StellaEndpointGeneratorTests
|
||||
|
||||
#region Path Escaping Tests
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Generator_WithSpecialCharactersInPath_EscapesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
@@ -513,6 +527,7 @@ public sealed class StellaEndpointGeneratorTests
|
||||
using System.Threading.Tasks;
|
||||
using StellaOps.Microservice;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace TestNamespace
|
||||
{
|
||||
public record Req();
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<ProjectReference Include="..\..\StellaOps.Microservice.SourceGen\StellaOps.Microservice.SourceGen.csproj" />
|
||||
<ProjectReference Include="..\..\StellaOps.Microservice\StellaOps.Microservice.csproj" />
|
||||
<ProjectReference Include="..\..\StellaOps.Router.Common\StellaOps.Router.Common.csproj" />
|
||||
<ProjectReference Include="../../StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user