Browse Source
Merge pull request #24534 from abpframework/unit-test-rider
Fix unit tests in Rider.
pull/24535/head
Halil İbrahim Kalkan
1 month ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>(); |
|
|
|
|