Add signal contracts for reachability, exploitability, trust, and unknown symbols
- Introduced `ReachabilityState`, `RuntimeHit`, `ExploitabilitySignal`, `ReachabilitySignal`, `SignalEnvelope`, `SignalType`, `TrustSignal`, and `UnknownSymbolSignal` records to define various signal types and their properties. - Implemented JSON serialization attributes for proper data interchange. - Created project files for the new signal contracts library and corresponding test projects. - Added deterministic test fixtures for micro-interaction testing. - Included cryptographic keys for secure operations with cosign.
This commit is contained in:
40
tests/StellaOps.Router.Common.Tests/FrameTypeTests.cs
Normal file
40
tests/StellaOps.Router.Common.Tests/FrameTypeTests.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using StellaOps.Router.Common;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Router.Common.Tests;
|
||||
|
||||
public class FrameTypeTests
|
||||
{
|
||||
[Fact]
|
||||
public void FrameType_HasExpectedValues()
|
||||
{
|
||||
// Verify all expected frame types exist
|
||||
Assert.True(Enum.IsDefined(typeof(FrameType), FrameType.Hello));
|
||||
Assert.True(Enum.IsDefined(typeof(FrameType), FrameType.Heartbeat));
|
||||
Assert.True(Enum.IsDefined(typeof(FrameType), FrameType.Request));
|
||||
Assert.True(Enum.IsDefined(typeof(FrameType), FrameType.Response));
|
||||
Assert.True(Enum.IsDefined(typeof(FrameType), FrameType.Cancel));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TransportType_HasExpectedValues()
|
||||
{
|
||||
// Verify all expected transport types exist
|
||||
Assert.True(Enum.IsDefined(typeof(TransportType), TransportType.InMemory));
|
||||
Assert.True(Enum.IsDefined(typeof(TransportType), TransportType.Tcp));
|
||||
Assert.True(Enum.IsDefined(typeof(TransportType), TransportType.Tls));
|
||||
Assert.True(Enum.IsDefined(typeof(TransportType), TransportType.Udp));
|
||||
Assert.True(Enum.IsDefined(typeof(TransportType), TransportType.RabbitMq));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InstanceHealthStatus_HasExpectedValues()
|
||||
{
|
||||
// Verify all expected health statuses exist
|
||||
Assert.True(Enum.IsDefined(typeof(InstanceHealthStatus), InstanceHealthStatus.Unknown));
|
||||
Assert.True(Enum.IsDefined(typeof(InstanceHealthStatus), InstanceHealthStatus.Healthy));
|
||||
Assert.True(Enum.IsDefined(typeof(InstanceHealthStatus), InstanceHealthStatus.Degraded));
|
||||
Assert.True(Enum.IsDefined(typeof(InstanceHealthStatus), InstanceHealthStatus.Draining));
|
||||
Assert.True(Enum.IsDefined(typeof(InstanceHealthStatus), InstanceHealthStatus.Unhealthy));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.4">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\__Libraries\StellaOps.Router.Common\StellaOps.Router.Common.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user