Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -13,7 +13,8 @@ namespace StellaOps.Scanner.Diff.Tests;
|
||||
|
||||
public sealed class ComponentDifferTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Compute_CapturesAddedRemovedAndChangedComponents()
|
||||
{
|
||||
var oldFragments = new[]
|
||||
@@ -173,7 +174,8 @@ public sealed class ComponentDifferTests
|
||||
Assert.False(removedJson.TryGetProperty("introducingLayer", out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Compute_UsageView_FiltersComponents()
|
||||
{
|
||||
var oldFragments = new[]
|
||||
@@ -218,7 +220,8 @@ public sealed class ComponentDifferTests
|
||||
Assert.False(parsed.RootElement.TryGetProperty("newImageDigest", out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Compute_MetadataChange_WhenEvidenceDiffers()
|
||||
{
|
||||
var oldFragments = new[]
|
||||
@@ -277,7 +280,8 @@ public sealed class ComponentDifferTests
|
||||
Assert.Equal(1, change.OldComponent!.Evidence.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public void Compute_MetadataChange_WhenBuildIdDiffers()
|
||||
{
|
||||
var oldFragments = new[]
|
||||
@@ -333,6 +337,7 @@ public sealed class ComponentDifferTests
|
||||
|
||||
var json = DiffJsonSerializer.Serialize(document);
|
||||
using var parsed = JsonDocument.Parse(json);
|
||||
using StellaOps.TestKit;
|
||||
var changeJson = parsed.RootElement
|
||||
.GetProperty("layers")[0]
|
||||
.GetProperty("changes")[0];
|
||||
|
||||
Reference in New Issue
Block a user