mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
18 lines
680 B
C#
18 lines
680 B
C#
using Microsoft.AspNetCore.Mvc.Testing;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace OpenAuth.WebApi.Test
|
|
{
|
|
/// <summary>
|
|
/// Based upon https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/test/integration-tests/samples/3.x/IntegrationTestsSample
|
|
/// </summary>
|
|
/// <typeparam name="TStartup"></typeparam>
|
|
public class AutofacWebApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup : class
|
|
{
|
|
protected override IHost CreateHost(IHostBuilder builder)
|
|
{
|
|
builder.UseServiceProviderFactory(new CustomServiceProviderFactory());
|
|
return base.CreateHost(builder);
|
|
}
|
|
}
|
|
} |