tests: setup initial infra for end to end tests

This commit is contained in:
Stevan Freeborn
2024-04-03 16:21:38 -05:00
parent c7c24965b3
commit 1f5d45f003
10 changed files with 98 additions and 3 deletions
@@ -0,0 +1,15 @@
namespace Blog.Tests.EndToEnd;
public class BlogHostFactory<TProgram> : WebApplicationFactory<TProgram> where TProgram : class
{
protected override IHost CreateHost(IHostBuilder builder)
{
var testHost = base.CreateHost(builder);
builder.ConfigureWebHost(webHostBuilder => webHostBuilder.UseKestrel());
var kestrelHost = builder.Build();
kestrelHost.Start();
return new CompositeHost(testHost, kestrelHost);
}
}