Refactor code structure and optimize performance across multiple modules
This commit is contained in:
@@ -56,7 +56,8 @@ public class IssuerDirectoryClientTests
|
||||
};
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task SetIssuerTrustAsync_SendsAuditMetadataAndInvalidatesCache()
|
||||
{
|
||||
var handler = new RecordingHandler(
|
||||
@@ -90,6 +91,7 @@ public class IssuerDirectoryClientTests
|
||||
reasonValues!.Should().Equal("rollout");
|
||||
|
||||
using var document = JsonDocument.Parse(putRequest.Body ?? string.Empty);
|
||||
using StellaOps.TestKit;
|
||||
var root = document.RootElement;
|
||||
root.GetProperty("weight").GetDecimal().Should().Be(1.5m);
|
||||
root.GetProperty("reason").GetString().Should().Be("rollout");
|
||||
@@ -99,7 +101,8 @@ public class IssuerDirectoryClientTests
|
||||
handler.Requests[2].Method.Should().Be(HttpMethod.Get);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task DeleteIssuerTrustAsync_UsesDeleteVerbAndReasonHeaderWhenProvided()
|
||||
{
|
||||
var handler = new RecordingHandler(
|
||||
@@ -131,7 +134,8 @@ public class IssuerDirectoryClientTests
|
||||
handler.Requests[2].Method.Should().Be(HttpMethod.Get);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task SetIssuerTrustAsync_PropagatesFailureAndDoesNotEvictCache()
|
||||
{
|
||||
var handler = new RecordingHandler(
|
||||
|
||||
@@ -41,7 +41,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsAuditEntry()
|
||||
{
|
||||
var entry = CreateAuditEntry("issuer.created", "Issuer was created");
|
||||
@@ -55,7 +56,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
persisted.Actor.Should().Be("test@test.com");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsMetadata()
|
||||
{
|
||||
var metadata = new Dictionary<string, string>
|
||||
@@ -75,7 +77,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
persisted.Details["newSlug"].Should().Be("new-issuer");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsEmptyMetadata()
|
||||
{
|
||||
var entry = CreateAuditEntry("issuer.deleted", "Issuer removed");
|
||||
@@ -88,7 +91,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
persisted.Details.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsNullReason()
|
||||
{
|
||||
var entry = CreateAuditEntry("issuer.updated", null);
|
||||
@@ -100,7 +104,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
persisted!.Reason.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsTimestampCorrectly()
|
||||
{
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
@@ -113,7 +118,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
persisted!.OccurredAt.Should().BeCloseTo(now.UtcDateTime, TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsMultipleEntriesForSameIssuer()
|
||||
{
|
||||
var entry1 = CreateAuditEntry("issuer.created", "Created");
|
||||
@@ -128,7 +134,8 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
count.Should().Be(3);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task WriteAsync_PersistsActorCorrectly()
|
||||
{
|
||||
var entry = new IssuerAuditEntry(
|
||||
@@ -232,6 +239,7 @@ public sealed class IssuerAuditSinkTests : IAsyncLifetime
|
||||
""";
|
||||
|
||||
await using var command = new NpgsqlCommand(sql, connection);
|
||||
using StellaOps.TestKit;
|
||||
command.Parameters.AddWithValue("tenantId", Guid.Parse(tenantId));
|
||||
command.Parameters.AddWithValue("issuerId", Guid.Parse(issuerId));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Core.Domain;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
[Collection(IssuerDirectoryPostgresCollection.Name)]
|
||||
@@ -38,7 +39,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_CreatesNewKey()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-001", IssuerKeyType.Ed25519PublicKey);
|
||||
@@ -52,7 +54,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched.Status.Should().Be(IssuerKeyStatus.Active);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_UpdatesExistingKey()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-update", IssuerKeyType.Ed25519PublicKey);
|
||||
@@ -74,7 +77,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched.RetiredAtUtc.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetAsync_ReturnsNullForNonExistentKey()
|
||||
{
|
||||
var result = await _keyRepository.GetAsync(_tenantId, _issuerId, "nonexistent", CancellationToken.None);
|
||||
@@ -82,7 +86,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetByFingerprintAsync_ReturnsKey()
|
||||
{
|
||||
var fingerprint = $"fp_{Guid.NewGuid():N}";
|
||||
@@ -95,7 +100,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched!.Fingerprint.Should().Be(fingerprint);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task ListAsync_ReturnsAllKeysForIssuer()
|
||||
{
|
||||
var key1 = CreateKeyRecord("key-list-1", IssuerKeyType.Ed25519PublicKey);
|
||||
@@ -110,7 +116,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
results.Select(k => k.Id).Should().BeEquivalentTo(["key-list-1", "key-list-2"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task ListGlobalAsync_ReturnsGlobalKeys()
|
||||
{
|
||||
var globalIssuerId = await SeedGlobalIssuerAsync();
|
||||
@@ -122,7 +129,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
results.Should().Contain(k => k.Id == "global-key");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsKeyTypeEd25519()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-ed25519", IssuerKeyType.Ed25519PublicKey);
|
||||
@@ -134,7 +142,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched!.Type.Should().Be(IssuerKeyType.Ed25519PublicKey);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsKeyTypeX509()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-x509", IssuerKeyType.X509Certificate);
|
||||
@@ -146,7 +155,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched!.Type.Should().Be(IssuerKeyType.X509Certificate);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsKeyTypeDsse()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-dsse", IssuerKeyType.DssePublicKey);
|
||||
@@ -158,7 +168,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched!.Type.Should().Be(IssuerKeyType.DssePublicKey);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsRevokedStatus()
|
||||
{
|
||||
var keyRecord = CreateKeyRecord("key-revoked", IssuerKeyType.Ed25519PublicKey) with
|
||||
@@ -175,7 +186,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched.RevokedAtUtc.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsReplacesKeyId()
|
||||
{
|
||||
var oldKey = CreateKeyRecord("old-key", IssuerKeyType.Ed25519PublicKey) with
|
||||
@@ -197,7 +209,8 @@ public sealed class IssuerKeyRepositoryTests : IAsyncLifetime
|
||||
fetched!.ReplacesKeyId.Should().Be("old-key");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsExpirationDate()
|
||||
{
|
||||
var expiresAt = DateTimeOffset.UtcNow.AddYears(1);
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Core.Domain;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
[Collection(IssuerDirectoryPostgresCollection.Name)]
|
||||
@@ -34,7 +35,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_CreatesNewIssuer()
|
||||
{
|
||||
var record = CreateIssuerRecord("test-issuer", "Test Issuer");
|
||||
@@ -49,7 +51,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.TenantId.Should().Be(_tenantId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_UpdatesExistingIssuer()
|
||||
{
|
||||
var record = CreateIssuerRecord("update-test", "Original Name");
|
||||
@@ -71,7 +74,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.Description.Should().Be("Updated description");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetAsync_ReturnsNullForNonExistentIssuer()
|
||||
{
|
||||
var result = await _repository.GetAsync(_tenantId, Guid.NewGuid().ToString(), CancellationToken.None);
|
||||
@@ -79,7 +83,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task ListAsync_ReturnsAllIssuersForTenant()
|
||||
{
|
||||
var issuer1 = CreateIssuerRecord("issuer-a", "Issuer A");
|
||||
@@ -94,7 +99,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
results.Select(i => i.Slug).Should().BeEquivalentTo(["issuer-a", "issuer-b"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task ListGlobalAsync_ReturnsGlobalIssuers()
|
||||
{
|
||||
var globalIssuer = CreateIssuerRecord("global-issuer", "Global Issuer", IssuerTenants.Global);
|
||||
@@ -105,7 +111,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
results.Should().Contain(i => i.Slug == "global-issuer");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task DeleteAsync_RemovesIssuer()
|
||||
{
|
||||
var record = CreateIssuerRecord("to-delete", "To Delete");
|
||||
@@ -117,7 +124,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsContactInformation()
|
||||
{
|
||||
var contact = new IssuerContact(
|
||||
@@ -138,7 +146,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.Contact.Timezone.Should().Be("UTC");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsEndpoints()
|
||||
{
|
||||
var endpoints = new List<IssuerEndpoint>
|
||||
@@ -158,7 +167,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.Endpoints.Should().Contain(e => e.Kind == "oidc" && e.RequiresAuthentication);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsMetadata()
|
||||
{
|
||||
var metadata = new IssuerMetadata(
|
||||
@@ -181,7 +191,8 @@ public sealed class IssuerRepositoryTests : IAsyncLifetime
|
||||
fetched.Metadata.Attributes.Should().ContainKey("custom");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsTags()
|
||||
{
|
||||
var record = CreateIssuerRecord("tags-test", "Tags Test") with
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Core.Domain;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
[Collection(IssuerDirectoryPostgresCollection.Name)]
|
||||
@@ -38,7 +39,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
|
||||
public Task DisposeAsync() => Task.CompletedTask;
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_CreatesNewTrustOverride()
|
||||
{
|
||||
var record = CreateTrustRecord(5.5m, "Trusted vendor");
|
||||
@@ -51,7 +53,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched.Reason.Should().Be("Trusted vendor");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_UpdatesExistingTrustOverride()
|
||||
{
|
||||
var record = CreateTrustRecord(3.0m, "Initial trust");
|
||||
@@ -68,7 +71,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched.UpdatedBy.Should().Be("admin@test.com");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task GetAsync_ReturnsNullForNonExistentOverride()
|
||||
{
|
||||
var result = await _trustRepository.GetAsync(_tenantId, Guid.NewGuid().ToString(), CancellationToken.None);
|
||||
@@ -76,7 +80,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
result.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task DeleteAsync_RemovesTrustOverride()
|
||||
{
|
||||
var record = CreateTrustRecord(2.0m, "To be deleted");
|
||||
@@ -88,7 +93,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsPositiveWeight()
|
||||
{
|
||||
var record = CreateTrustRecord(10.0m, "Maximum trust");
|
||||
@@ -100,7 +106,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched!.Weight.Should().Be(10.0m);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsNegativeWeight()
|
||||
{
|
||||
var record = CreateTrustRecord(-5.0m, "Distrust override");
|
||||
@@ -112,7 +119,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched!.Weight.Should().Be(-5.0m);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsZeroWeight()
|
||||
{
|
||||
var record = CreateTrustRecord(0m, "Neutral trust");
|
||||
@@ -124,7 +132,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched!.Weight.Should().Be(0m);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsNullReason()
|
||||
{
|
||||
var record = CreateTrustRecord(5.0m, null);
|
||||
@@ -136,7 +145,8 @@ public sealed class IssuerTrustRepositoryTests : IAsyncLifetime
|
||||
fetched!.Reason.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAsync_PersistsTimestamps()
|
||||
{
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Storage.Postgres;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
public class IssuerKeyRepositoryTests : IClassFixture<IssuerDirectoryPostgresFixture>
|
||||
@@ -24,7 +25,8 @@ public class IssuerKeyRepositoryTests : IClassFixture<IssuerDirectoryPostgresFix
|
||||
new(new IssuerDirectoryDataSource(_fixture.Fixture.Options, NullLogger<IssuerDirectoryDataSource>.Instance),
|
||||
NullLogger<PostgresIssuerKeyRepository>.Instance);
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task AddKey_And_List_Works()
|
||||
{
|
||||
var tenant = Guid.NewGuid().ToString();
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Storage.Postgres;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
public class IssuerRepositoryTests : IClassFixture<IssuerDirectoryPostgresFixture>
|
||||
@@ -24,7 +25,8 @@ public class IssuerRepositoryTests : IClassFixture<IssuerDirectoryPostgresFixtur
|
||||
return new PostgresIssuerRepository(dataSource, NullLogger<PostgresIssuerRepository>.Instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertAndGet_Works_For_Tenant()
|
||||
{
|
||||
var repo = CreateRepository();
|
||||
|
||||
@@ -5,6 +5,7 @@ using StellaOps.IssuerDirectory.Storage.Postgres;
|
||||
using StellaOps.IssuerDirectory.Storage.Postgres.Repositories;
|
||||
using Xunit;
|
||||
|
||||
using StellaOps.TestKit;
|
||||
namespace StellaOps.IssuerDirectory.Storage.Postgres.Tests;
|
||||
|
||||
public class TrustRepositoryTests : IClassFixture<IssuerDirectoryPostgresFixture>
|
||||
@@ -24,7 +25,8 @@ public class TrustRepositoryTests : IClassFixture<IssuerDirectoryPostgresFixture
|
||||
new(new IssuerDirectoryDataSource(_fixture.Fixture.Options, NullLogger<IssuerDirectoryDataSource>.Instance),
|
||||
NullLogger<PostgresIssuerTrustRepository>.Instance);
|
||||
|
||||
[Fact]
|
||||
[Trait("Category", TestCategories.Unit)]
|
||||
[Fact]
|
||||
public async Task UpsertTrustOverride_Works()
|
||||
{
|
||||
var tenant = Guid.NewGuid().ToString();
|
||||
|
||||
Reference in New Issue
Block a user