part #2
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using StellaOps.Evidence.Bundle;
|
||||
using StellaOps.Evidence.Core.Adapters;
|
||||
using StellaOps.TestKit;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Evidence.Core.Tests;
|
||||
|
||||
public sealed class EvidenceBundleAdapterTests
|
||||
{
|
||||
private readonly EvidenceBundleAdapter _adapter = new();
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void CanConvert_WithNull_ReturnsFalse()
|
||||
{
|
||||
Assert.False(_adapter.CanConvert(null!));
|
||||
}
|
||||
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Convert_WithBinaryDiff_ReturnsArtifactEvidence()
|
||||
{
|
||||
var bundle = new EvidenceBundle
|
||||
{
|
||||
AlertId = "ALERT-100",
|
||||
ArtifactId = "sha256:artifact",
|
||||
Hashes = EvidenceHashSet.Empty(),
|
||||
CreatedAt = new DateTimeOffset(2026, 2, 4, 0, 0, 0, TimeSpan.Zero),
|
||||
BinaryDiff = new BinaryDiffEvidence
|
||||
{
|
||||
Status = EvidenceStatus.Available,
|
||||
DiffType = BinaryDiffType.Structural
|
||||
}
|
||||
};
|
||||
|
||||
var provenance = new EvidenceProvenance
|
||||
{
|
||||
GeneratorId = "stellaops/scanner/test",
|
||||
GeneratorVersion = "1.0.0",
|
||||
GeneratedAt = new DateTimeOffset(2026, 2, 4, 0, 0, 0, TimeSpan.Zero)
|
||||
};
|
||||
|
||||
var results = _adapter.Convert(bundle, "sha256:subject", provenance);
|
||||
|
||||
Assert.Single(results);
|
||||
Assert.Equal(EvidenceType.Artifact, results[0].EvidenceType);
|
||||
Assert.False(results[0].Payload.IsEmpty);
|
||||
}
|
||||
}
|
||||
@@ -9,3 +9,4 @@ Source of truth: `docs-archived/implplan/2025-12-29-csproj-audit/SPRINT_20251229
|
||||
| AUDIT-0079-T | DONE | Revalidated 2026-01-08; open findings tracked in audit report. |
|
||||
| AUDIT-0079-A | DONE | Waived (test project; revalidated 2026-01-08). |
|
||||
| REMED-06 | DONE | SOLID review notes captured for SPRINT_20260130_002. |
|
||||
| REMED-07 | DONE | Added EvidenceBundleAdapter coverage; dotnet test 2026-02-04 (113 tests). |
|
||||
|
||||
Reference in New Issue
Block a user