Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DefaultBuilder/src/WebApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed class WebApplication : IHost, IApplicationBuilder, IEndpointRouteB
internal WebApplication(IHost host)
{
_host = host;
ApplicationBuilder = new ApplicationBuilder(host.Services);
ApplicationBuilder = new ApplicationBuilder(host.Services, ServerFeatures);
Logger = host.Services.GetRequiredService<ILoggerFactory>().CreateLogger(Environment.ApplicationName);

Properties[GlobalEndpointRouteBuilderKey] = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ namespace Microsoft.AspNetCore.Tests;

public class WebApplicationTests
{
[Fact]
public async Task WebApplicationBuilder_New()
{
var builder = WebApplication.CreateBuilder(new string[] { "--urls", "http://localhost:5001" });

await using var app = builder.Build();
var newApp = (app as IApplicationBuilder).New();
Assert.NotNull(newApp.ServerFeatures);
}

[Fact]
public async Task WebApplicationBuilderConfiguration_IncludesCommandLineArguments()
{
Expand Down