aspnet / Hosting

[Archived] Code for hosting and starting up an ASP.NET Core application. Project moved to https://github.com/aspnet/Extensions and https://github.com/aspnet/AspNetCore
Apache License 2.0
552 stars 312 forks source link

Add TestServer support for generic WebHost #1595

Closed Tratcher closed 5 years ago

Tratcher commented 5 years ago

1583 Create new test patterns for anyone using generic host.

Tratcher commented 5 years ago

Note to self:

            var host = await new HostBuilder()
                .ConfigureWebHost(webBuilder =>
                {
                    webBuilder
                        .UseTestServer()
                        .Configure(app => { });
                })
                .StartAsync();

             var response = await host.GetTestClient().GetAsync("/");
Tratcher commented 5 years ago

Updated with more distinct types of sugar.