feature:添加集成测试
This commit is contained in:
18
Api/Ewide.Test/CustomWebApplicationFactory.cs
Normal file
18
Api/Ewide.Test/CustomWebApplicationFactory.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.Test
|
||||
{
|
||||
public class CustomWebApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup : class
|
||||
{
|
||||
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||||
{
|
||||
builder.UseEnvironment("Testing");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user