Skip to content

Instantly share code, notes, and snippets.

@zbartl
Created June 6, 2017 20:34
Show Gist options
  • Save zbartl/f25a009b0e7831ca519a80a2e1cbe577 to your computer and use it in GitHub Desktop.
Save zbartl/f25a009b0e7831ca519a80a2e1cbe577 to your computer and use it in GitHub Desktop.
aspnetcore integration test - startup
public class Startup
{
...
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
...
app.UseIdentity();
ConfigureAdditionalMiddleware(app);
app.UseMvc();
}
protected virtual void ConfigureAdditionalMiddleware(IApplicationBuilder app)
{
}
}
public class TestServerStartup : Startup
{
public TestServerStartup(IHostingEnvironment env) : base(env)
{
}
protected override void ConfigureAdditionalMiddleware(IApplicationBuilder app)
{
app.UseMiddleware<TestMiddleware.AuthenticatedTestRequestMiddleware>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment