You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
755 B
C#
33 lines
755 B
C#
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.AspNetCore.TestHost;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using ConfigureStudy.WebApp;
|
|
|
|
namespace ConfigureStudy.Test
|
|
{
|
|
public class TestServerFixture : IDisposable
|
|
{
|
|
public TestServer TestServer;
|
|
|
|
/// <summary>
|
|
/// 设置测试内存服务器 TestServer
|
|
/// </summary>
|
|
public TestServerFixture()
|
|
{
|
|
IWebHostBuilder webHostBuilder = new WebHostBuilder();
|
|
|
|
//WebHostBuilderExtensions
|
|
webHostBuilder.UseStartup<Startup>();
|
|
|
|
TestServer = new TestServer(webHostBuilder);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
TestServer = null;
|
|
}
|
|
}
|
|
}
|