Skip to content

Instantly share code, notes, and snippets.

@zbartl
Last active June 6, 2017 19:57
Show Gist options
  • Save zbartl/683c53d6a0e138d7acbe9a130b16dcd9 to your computer and use it in GitHub Desktop.
Save zbartl/683c53d6a0e138d7acbe9a130b16dcd9 to your computer and use it in GitHub Desktop.
aspnetcore integration test - fixture
public class TestServerFixture
{
public TestServer Server { get; private set; }
public HttpClient Client { get; private set; }
public TestServerFixture()
{
var builder = new WebHostBuilder()
.UseStartup(typeof(Startup));
Server = new TestServer(builder);
Client = Server.CreateClient();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment