diff --git a/test/Microsoft.AspNet.Cors.Test/CorsMiddlewareTests.cs b/test/Microsoft.AspNet.Cors.Test/CorsMiddlewareTests.cs index 2f75531..0e8e718 100644 --- a/test/Microsoft.AspNet.Cors.Test/CorsMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Cors.Test/CorsMiddlewareTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure public async Task CorsRequest_MatchPolicy_SetsResponseHeaders() { // Arrange - var appBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .Configure(app => { app.UseCors(builder => @@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure }) .ConfigureServices(services => services.AddCors()); - using (var server = new TestServer(appBuilder)) + using (var server = new TestServer(hostBuilder)) { // Act // Actual request. @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure policy.Headers.Add("Header1"); policy.ExposedHeaders.Add("AllowedHeader"); - var appBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .Configure(app => { app.UseCors("customPolicy"); @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure }); }); - using (var server = new TestServer(appBuilder)) + using (var server = new TestServer(hostBuilder)) { // Act // Preflight request. @@ -101,7 +101,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure public async Task PreFlightRequest_DoesNotMatchPolicy_DoesNotSetHeaders() { // Arrange - var appBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .Configure(app => { app.UseCors(builder => @@ -116,7 +116,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure }) .ConfigureServices(services => services.AddCors()); - using (var server = new TestServer(appBuilder)) + using (var server = new TestServer(hostBuilder)) { // Act // Preflight request. @@ -135,7 +135,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure public async Task CorsRequest_DoesNotMatchPolicy_DoesNotSetHeaders() { // Arrange - var appBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .Configure(app => { app.UseCors(builder => @@ -150,7 +150,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure }) .ConfigureServices(services => services.AddCors()); - using (var server = new TestServer(appBuilder)) + using (var server = new TestServer(hostBuilder)) { // Act // Actual request. diff --git a/test/Microsoft.AspNet.Cors.Test/CorsTestFixtureOfT.cs b/test/Microsoft.AspNet.Cors.Test/CorsTestFixtureOfT.cs index 1f83c64..f3c11d5 100644 --- a/test/Microsoft.AspNet.Cors.Test/CorsTestFixtureOfT.cs +++ b/test/Microsoft.AspNet.Cors.Test/CorsTestFixtureOfT.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Cors.Infrastructure public CorsTestFixture() { - var builder = new WebApplicationBuilder().UseStartup(); + var builder = new WebHostBuilder().UseStartup(); _server = new TestServer(builder); Client = _server.CreateClient(); diff --git a/test/WebSites/CorsMiddlewareWebSite/Startup.cs b/test/WebSites/CorsMiddlewareWebSite/Startup.cs index 08f8283..436b8cd 100644 --- a/test/WebSites/CorsMiddlewareWebSite/Startup.cs +++ b/test/WebSites/CorsMiddlewareWebSite/Startup.cs @@ -21,13 +21,13 @@ namespace CorsMiddlewareWebSite } public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } \ No newline at end of file