Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -6,6 +6,8 @@ using StellaOps.Unknowns.Storage.Postgres.Repositories;
|
||||
using Testcontainers.PostgreSql;
|
||||
using Xunit;
|
||||
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.Unknowns.Storage.Postgres.Tests;
|
||||
|
||||
public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
@@ -128,7 +130,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
await command.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task CreateAsync_ShouldCreateUnknown()
|
||||
{
|
||||
// Arrange
|
||||
@@ -161,7 +164,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 +191,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 +202,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetOpenUnknownsAsync_ShouldReturnOnlyOpenUnknowns()
|
||||
{
|
||||
// Arrange
|
||||
@@ -234,7 +240,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 +270,8 @@ public sealed class PostgresUnknownRepositoryTests : IAsyncLifetime
|
||||
resolved.ValidTo.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task CountByKindAsync_ShouldReturnCorrectCounts()
|
||||
{
|
||||
// Arrange
|
||||
@@ -286,7 +294,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 +317,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
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\__Libraries\StellaOps.Unknowns.Storage.Postgres\StellaOps.Unknowns.Storage.Postgres.csproj" />
|
||||
<ProjectReference Include="../../../__Libraries/StellaOps.TestKit/StellaOps.TestKit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user