Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -20,7 +20,8 @@ public sealed class PostgresProofSpineRepositoryTests
|
||||
public PostgresProofSpineRepositoryTests(ScannerProofSpinePostgresFixture fixture)
|
||||
=> _fixture = fixture;
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task SaveAsync_ThenGetByIdAsync_RoundTripsSpine()
|
||||
{
|
||||
await _fixture.TruncateAllTablesAsync();
|
||||
@@ -37,6 +38,7 @@ public sealed class PostgresProofSpineRepositoryTests
|
||||
};
|
||||
|
||||
await using var dataSource = new ScannerDataSource(Options.Create(options), NullLogger<ScannerDataSource>.Instance);
|
||||
using StellaOps.TestKit;
|
||||
var repository = new PostgresProofSpineRepository(
|
||||
dataSource,
|
||||
NullLogger<PostgresProofSpineRepository>.Instance,
|
||||
|
||||
@@ -5,11 +5,13 @@ using StellaOps.Scanner.ProofSpine;
|
||||
using StellaOps.Scanner.ProofSpine.Options;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Scanner.ProofSpine.Tests;
|
||||
|
||||
public sealed class ProofSpineBuilderTests
|
||||
{
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task BuildAsync_SameInputs_ProducesSameIds()
|
||||
{
|
||||
var options = Options.Create(new ProofSpineDsseSigningOptions
|
||||
@@ -62,7 +64,8 @@ public sealed class ProofSpineBuilderTests
|
||||
Assert.Equal(spine1.Segments[1].SegmentId, spine2.Segments[1].SegmentId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task VerifyAsync_DetectsTampering()
|
||||
{
|
||||
var options = Options.Create(new ProofSpineDsseSigningOptions
|
||||
|
||||
Reference in New Issue
Block a user