Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Security.Claims;
|
||||
using Microsoft.Extensions.Options;
|
||||
using StellaOps.Registry.TokenService;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Registry.TokenService.Tests;
|
||||
|
||||
public sealed class PlanRegistryTests
|
||||
@@ -59,7 +60,8 @@ public sealed class PlanRegistryTests
|
||||
};
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Authorize_AllowsMatchingPlan()
|
||||
{
|
||||
var options = CreateOptions();
|
||||
@@ -85,7 +87,8 @@ public sealed class PlanRegistryTests
|
||||
Assert.True(decision.Allowed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Authorize_DeniesUnknownPlan()
|
||||
{
|
||||
var options = CreateOptions();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using StellaOps.Registry.TokenService;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Registry.TokenService.Tests;
|
||||
|
||||
public sealed class RegistryScopeParserTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Parse_SingleScope_DefaultsPull()
|
||||
{
|
||||
var query = new QueryCollection(new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>
|
||||
@@ -21,7 +23,8 @@ public sealed class RegistryScopeParserTests
|
||||
Assert.Equal(new[] { "pull" }, result[0].Actions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Parse_MultipleScopes()
|
||||
{
|
||||
var query = new QueryCollection(new Dictionary<string, Microsoft.Extensions.Primitives.StringValues>
|
||||
|
||||
@@ -5,13 +5,16 @@ using Microsoft.Extensions.Options;
|
||||
using StellaOps.Registry.TokenService;
|
||||
using StellaOps.Registry.TokenService.Observability;
|
||||
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Registry.TokenService.Tests;
|
||||
|
||||
public sealed class RegistryTokenIssuerTests : IDisposable
|
||||
{
|
||||
private readonly List<string> _tempFiles = new();
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void IssueToken_GeneratesJwtWithAccessClaim()
|
||||
{
|
||||
var pemPath = CreatePemKey();
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../StellaOps.Registry.TokenService/StellaOps.Registry.TokenService.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,8 +1,10 @@
|
||||
namespace StellaOps.Registry.TokenService.Tests;
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Registry.TokenService.Tests;
|
||||
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user