Watch
1
0
Fork
You've already forked test-web
0

Initial commit
All checks were successful
Build / build (push) Successful in 43s

This commit is contained in:
Chris 2026-06-06 10:39:37 +01:00
commit 1199bef0c8

28
tests/TestFixture.cs Normal file
View file

@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc.Testing;
[assembly: AssemblyFixture(typeof(TestWeb.Tests.TestFixture))]
namespace TestWeb.Tests;
public class TestFixture : IAsyncLifetime
{
public HttpClient Client { get; private set; } = null!;
private readonly WebApplicationFactory<Program> factory;
public TestFixture()
{
factory = new WebApplicationFactory<Program>();
}
public ValueTask InitializeAsync()
{
Client = factory.CreateClient();
return ValueTask.CompletedTask;
}
public ValueTask DisposeAsync()
{
Client.Dispose();
return ValueTask.CompletedTask;
}
}