Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Net.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
namespace Blog.Turnmeup.API.Tests
{
public class TestFixture<TStartup> : IDisposable where TStartup : class
{
public readonly TestServer Server;
private readonly HttpClient Client;
public TestFixture()
{
var builder = new WebHostBuilder()
.UseContentRoot($"..\\..\\..\\..\\..\\src\\Blog.Turnmeup.API\\")
.UseStartup<TStartup>();
Server = new TestServer(builder);
Client = new HttpClient();
}
public void Dispose()
{
Client.Dispose();
Server.Dispose();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment