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

@@ -6,13 +6,15 @@ using StellaOps.Notify.Engine;
using StellaOps.Notify.Models;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Notify.Connectors.Slack.Tests;
public sealed class SlackChannelHealthProviderTests
{
private static readonly SlackChannelHealthProvider Provider = new();
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CheckAsync_ReturnsHealthy()
{
var channel = CreateChannel(enabled: true, target: "#sec-ops");
@@ -33,7 +35,8 @@ public sealed class SlackChannelHealthProviderTests
Assert.Equal(ComputeSecretHash(channel.Config.SecretRef), result.Metadata["slack.secretRef.hash"]);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CheckAsync_ReturnsDegradedWhenDisabled()
{
var channel = CreateChannel(enabled: false, target: "#sec-ops");
@@ -51,7 +54,8 @@ public sealed class SlackChannelHealthProviderTests
Assert.Equal("false", result.Metadata["slack.channel.enabled"]);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task CheckAsync_ReturnsUnhealthyWhenTargetMissing()
{
var channel = CreateChannel(enabled: true, target: null);

View File

@@ -7,6 +7,8 @@ using StellaOps.Notify.Engine;
using StellaOps.Notify.Models;
using Xunit;
using StellaOps.TestKit;
namespace StellaOps.Notify.Connectors.Slack.Tests;
public sealed class SlackChannelTestProviderTests
@@ -22,7 +24,8 @@ public sealed class SlackChannelTestProviderTests
Metadata: new Dictionary<string, string>(),
Attachments: new List<string>());
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task BuildPreviewAsync_ProducesDeterministicMetadata()
{
var provider = new SlackChannelTestProvider();
@@ -64,7 +67,8 @@ public sealed class SlackChannelTestProviderTests
Assert.Equal(ComputeSecretHash(channel.Config.SecretRef), result.Metadata["slack.secretRef.hash"]);
}
[Fact]
[Trait("Category", TestCategories.Unit)]
[Fact]
public async Task BuildPreviewAsync_RedactsSensitiveProperties()
{
var provider = new SlackChannelTestProvider();

View File

@@ -11,6 +11,7 @@
<ProjectReference Include="../../__Libraries/StellaOps.Notify.Connectors.Slack/StellaOps.Notify.Connectors.Slack.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Notify.Engine/StellaOps.Notify.Engine.csproj" />
<ProjectReference Include="../../__Libraries/StellaOps.Notify.Models/StellaOps.Notify.Models.csproj" />
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
</ItemGroup>
<ItemGroup>