Created
March 16, 2021 16:54
-
-
Save AnthonyGiretti/a443adaa5375f61d9c602dab0336107e to your computer and use it in GitHub Desktop.
Web application factory that uses a custom startup file for integration tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Hosting; | |
namespace Calzolari.WebApi.Tests.Common | |
{ | |
public class MyWebFactory : WebApplicationFactory<Startup> | |
{ | |
protected override IHostBuilder CreateHostBuilder() | |
{ | |
return Host.CreateDefaultBuilder().ConfigureWebHost((builder) => | |
{ | |
builder.UseStartup<TestStartup>(); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment