test(theme): verify bUnit 2.7.2 with patched DOM parser

This commit is contained in:
Joseph Doherty
2026-11-13 14:41:17 -05:00
parent 1118e0418e
commit 9bda64ec4b
23 changed files with 1298 additions and 2 deletions
@@ -0,0 +1,25 @@
using Bunit;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
public sealed class AsyncLifecycleTests
{
[Fact]
public async Task Context_awaits_async_service_disposal()
{
var context = new BunitContext();
context.Services.AddScoped<AsyncResource>();
var resource = context.Services.GetRequiredService<AsyncResource>();
Assert.False(resource.Disposed);
await context.DisposeAsync();
Assert.True(resource.Disposed);
}
public sealed class AsyncResource : IAsyncDisposable
{
public bool Disposed { get; private set; }
public async ValueTask DisposeAsync()
{
await Task.Yield();
Disposed = true;
}
}
}