Skip to content

Commit 85ed51b

Browse files
committed
Fix unit tests in Rider.
1 parent e66d88d commit 85ed51b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

framework/src/Volo.Abp.AspNetCore.TestBase/Volo/Abp/AspNetCore/TestBase/AbpWebApplicationFactoryIntegratedTest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Net.Http;
5+
using Microsoft.AspNetCore.Hosting;
56
using Microsoft.AspNetCore.Mvc.Testing;
67
using Microsoft.AspNetCore.Routing;
78
using Microsoft.Extensions.DependencyInjection;
@@ -33,6 +34,15 @@ protected override IHost CreateHost(IHostBuilder builder)
3334
return base.CreateHost(builder);
3435
}
3536

37+
protected override void ConfigureWebHost(IWebHostBuilder builder)
38+
{
39+
builder.ConfigureAppConfiguration((hostingContext, config) =>
40+
{
41+
hostingContext.HostingEnvironment.EnvironmentName = "Production";
42+
});
43+
base.ConfigureWebHost(builder);
44+
}
45+
3646
protected virtual T? GetService<T>()
3747
{
3848
return Services.GetService<T>();

0 commit comments

Comments
 (0)