Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -125,10 +125,12 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
""";
|
||||
|
||||
await using var command = new NpgsqlCommand(schema, connection);
|
||||
using StellaOps.TestKit;
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task CreateAsync_ShouldCreateUnknown()
|
||||
{
|
||||
// Arrange
|
||||
@@ -161,7 +163,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
result.IsCurrent.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetByIdAsync_ShouldReturnUnknown_WhenExists()
|
||||
{
|
||||
// Arrange
|
||||
@@ -187,7 +190,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
result.SubjectRef.Should().Be("pkg:npm/axios@0.21.0");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetByIdAsync_ShouldReturnNull_WhenNotExists()
|
||||
{
|
||||
// Act
|
||||
@@ -197,7 +201,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetOpenUnknownsAsync_ShouldReturnOnlyOpenUnknowns()
|
||||
{
|
||||
// Arrange
|
||||
@@ -234,7 +239,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
results[0].SubjectRef.Should().Be("pkg:npm/open1@1.0.0");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task ResolveAsync_ShouldMarkAsResolved()
|
||||
{
|
||||
// Arrange
|
||||
@@ -263,7 +269,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
resolved.ValidTo.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task CountByKindAsync_ShouldReturnCorrectCounts()
|
||||
{
|
||||
// Arrange
|
||||
@@ -286,7 +293,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
counts[UnknownKind.AmbiguousPackage].Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task AsOfAsync_ShouldReturnHistoricalState()
|
||||
{
|
||||
// Arrange
|
||||
@@ -308,7 +316,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
afterResults[0].Id.Should().Be(created.Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task SupersedeAsync_ShouldSetSysTo()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in New Issue
Block a user