Disposing the test fixtures
All checks were successful
Dotnet build and test / build (push) Successful in 6m49s

This commit is contained in:
Paul Schneider 2026-08-29 04:00:10 +01:00
commit 243c0f2780
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
5 changed files with 26 additions and 28 deletions

View file

@ -14,15 +14,10 @@ namespace Yavsc.Blogs.Tests;
[Collection("JwtClaimMapping")]
public sealed class BlogApiMappedClaimsTests :
IClassFixture<MappedClaimsBlogsWebServerFixture>,
IBackendFixture
IClassFixture<MappedClaimsBlogsWebServerFixture>
{
private readonly MappedClaimsBlogsWebServerFixture _fixture;
public IReadOnlyList<string> Addresses => throw new NotImplementedException();
public IServiceProvider Services => throw new NotImplementedException();
public BlogApiMappedClaimsTests(MappedClaimsBlogsWebServerFixture fixture)
{
_fixture = fixture;

View file

@ -25,7 +25,7 @@ public sealed class MappedClaimsBlogsWebServerFixture : IDisposable, IBackendFix
{
private readonly InMemoryDatabaseRoot _inMemoryRoot = new();
private readonly Dictionary<string, string> _savedInboundMap;
private readonly WebApplication _app;
private WebApplication? _app = null;
public MappedClaimsBlogsWebServerFixture()
{
@ -86,6 +86,7 @@ public sealed class MappedClaimsBlogsWebServerFixture : IDisposable, IBackendFix
public void Dispose()
{
if (_app is null) return;
_app.StopAsync().GetAwaiter().GetResult();
_app.DisposeAsync().AsTask().GetAwaiter().GetResult();
@ -96,6 +97,7 @@ public sealed class MappedClaimsBlogsWebServerFixture : IDisposable, IBackendFix
}
}
private sealed class NoopFileSystemAuthManager : IFileSystemAuthManager
{
public FileAccessRight GetFilePathAccess(System.Security.Claims.ClaimsPrincipal user, string fileRelativePath)