maliming
1 month ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
10 additions and
0 deletions
-
framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpWebApplicationFactoryIntegratedTest.cs
|
|
|
@ -2,6 +2,7 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Net.Http; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.AspNetCore.Mvc.Testing; |
|
|
|
using Microsoft.AspNetCore.Routing; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
@ -33,6 +34,15 @@ public abstract class AbpWebApplicationFactoryIntegratedTest<TProgram> : WebAppl |
|
|
|
return base.CreateHost(builder); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void ConfigureWebHost(IWebHostBuilder builder) |
|
|
|
{ |
|
|
|
builder.ConfigureAppConfiguration((hostingContext, config) => |
|
|
|
{ |
|
|
|
hostingContext.HostingEnvironment.EnvironmentName = "Production"; |
|
|
|
}); |
|
|
|
base.ConfigureWebHost(builder); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual T? GetService<T>() |
|
|
|
{ |
|
|
|
return Services.GetService<T>(); |
|
|
|
|