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

@@ -9,6 +9,8 @@ using StellaOps.Signals.Options;
using StellaOps.Signals.Services;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Signals.Tests;
public class EdgeBundleIngestionServiceTests
@@ -25,7 +27,8 @@ public class EdgeBundleIngestionServiceTests
_service = new EdgeBundleIngestionService(NullLogger<EdgeBundleIngestionService>.Instance, options);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IngestAsync_ParsesBundleAndStoresDocument()
{
// Arrange
@@ -58,7 +61,8 @@ public class EdgeBundleIngestionServiceTests
Assert.Contains("cas://reachability/edges/", result.CasUri);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IngestAsync_TracksRevokedEdgesForQuarantine()
{
// Arrange
@@ -87,7 +91,8 @@ public class EdgeBundleIngestionServiceTests
Assert.True(result.Quarantined);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IsEdgeRevokedAsync_ReturnsTrueForRevokedEdges()
{
// Arrange
@@ -110,7 +115,8 @@ public class EdgeBundleIngestionServiceTests
Assert.False(await _service.IsEdgeRevokedAsync(TestTenantId, TestGraphHash, "other_func", "some_func"));
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task GetBundlesForGraphAsync_ReturnsAllBundlesForGraph()
{
// Arrange - ingest multiple bundles
@@ -134,7 +140,8 @@ public class EdgeBundleIngestionServiceTests
Assert.Contains(bundles, b => b.BundleId == "bundle:2");
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task GetRevokedEdgesAsync_ReturnsOnlyRevokedEdges()
{
// Arrange
@@ -162,7 +169,8 @@ public class EdgeBundleIngestionServiceTests
Assert.All(revokedEdges, e => Assert.True(e.Revoked));
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IngestAsync_WithDsseStream_SetsVerifiedAndDsseFields()
{
// Arrange
@@ -191,7 +199,8 @@ public class EdgeBundleIngestionServiceTests
Assert.EndsWith(".dsse", result.DsseCasUri);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IngestAsync_ThrowsOnMissingGraphHash()
{
// Arrange
@@ -207,7 +216,8 @@ public class EdgeBundleIngestionServiceTests
await Assert.ThrowsAsync<InvalidOperationException>(() => _service.IngestAsync(TestTenantId, stream, null));
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task IngestAsync_UpdatesExistingBundleWithSameId()
{
// Arrange