File tree 5 files changed +30
-1
lines changed
test/Microsoft.AspNetCore.Tests 5 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 17
17
"src\\Http\\Http.Features\\src\\Microsoft.AspNetCore.Http.Features.csproj",
18
18
"src\\Http\\Http\\src\\Microsoft.AspNetCore.Http.csproj",
19
19
"src\\Http\\WebUtilities\\src\\Microsoft.AspNetCore.WebUtilities.csproj",
20
+ "src\\Middleware\\ResponseCaching.Abstractions\\src\\Microsoft.AspNetCore.ResponseCaching.Abstractions.csproj",
20
21
"src\\Middleware\\StaticFiles\\src\\Microsoft.AspNetCore.StaticFiles.csproj",
21
- "src\\ObjectPool\\src\\Microsoft.Extensions.ObjectPool.csproj"
22
+ "src\\Mvc\\Mvc.Abstractions\\src\\Microsoft.AspNetCore.Mvc.Abstractions.csproj",
23
+ "src\\Mvc\\Mvc.ApiExplorer\\src\\Microsoft.AspNetCore.Mvc.ApiExplorer.csproj",
24
+ "src\\Mvc\\Mvc.Core\\src\\Microsoft.AspNetCore.Mvc.Core.csproj",
25
+ "src\\ObjectPool\\src\\Microsoft.Extensions.ObjectPool.csproj",
26
+ "src\\Security\\Authentication\\Core\\src\\Microsoft.AspNetCore.Authentication.csproj",
27
+ "src\\Security\\Authorization\\Policy\\src\\Microsoft.AspNetCore.Authorization.Policy.csproj"
22
28
]
23
29
}
24
30
}
Original file line number Diff line number Diff line change 18
18
<Reference Include =" Microsoft.AspNetCore.Server.IIS" />
19
19
<Reference Include =" Microsoft.AspNetCore.Server.IISIntegration" />
20
20
<Reference Include =" Microsoft.AspNetCore.Server.Kestrel" />
21
+ <Reference Include =" Microsoft.AspNetCore.Mvc.ApiExplorer" />
21
22
<Reference Include =" Microsoft.Extensions.Configuration.EnvironmentVariables" />
22
23
<Reference Include =" Microsoft.Extensions.Configuration.FileExtensions" />
23
24
<Reference Include =" Microsoft.Extensions.Configuration.Json" />
Original file line number Diff line number Diff line change @@ -259,6 +259,7 @@ internal static void ConfigureWebDefaults(IWebHostBuilder builder)
259
259
}
260
260
261
261
services . AddRouting ( ) ;
262
+ services . AddEndpointsApiExplorer ( ) ;
262
263
} )
263
264
. UseIIS ( )
264
265
. UseIISIntegration ( ) ;
Original file line number Diff line number Diff line change 15
15
using Microsoft . AspNetCore . Hosting . Server ;
16
16
using Microsoft . AspNetCore . Hosting . Server . Features ;
17
17
using Microsoft . AspNetCore . Http . Features ;
18
+ using Microsoft . AspNetCore . Mvc . ApiExplorer ;
18
19
using Microsoft . AspNetCore . Routing ;
19
20
using Microsoft . AspNetCore . TestHost ;
20
21
using Microsoft . AspNetCore . Testing ;
@@ -269,6 +270,14 @@ public void WebApplicationCreate_RegistersRouting()
269
270
Assert . NotNull ( linkGenerator ) ;
270
271
}
271
272
273
+ [ Fact ]
274
+ public void WebApplicationCreate_RegistersApiExplorerForEndpoints ( )
275
+ {
276
+ var app = WebApplication . Create ( ) ;
277
+ var apiDescriptionProvider = app . Services . GetService ( typeof ( IApiDescriptionProvider ) ) ;
278
+ Assert . NotNull ( apiDescriptionProvider ) ;
279
+ }
280
+
272
281
[ Fact ]
273
282
public void WebApplicationCreate_RegistersEventSourceLogger ( )
274
283
{
Original file line number Diff line number Diff line change 11
11
using Microsoft . AspNetCore . Builder ;
12
12
using Microsoft . AspNetCore . HostFiltering ;
13
13
using Microsoft . AspNetCore . Hosting ;
14
+ using Microsoft . AspNetCore . Mvc . ApiExplorer ;
14
15
using Microsoft . AspNetCore . Routing ;
15
16
using Microsoft . AspNetCore . TestHost ;
16
17
using Microsoft . AspNetCore . Testing ;
@@ -99,6 +100,17 @@ public void CreateDefaultBuilder_RegistersRouting()
99
100
Assert . NotNull ( linkGenerator ) ;
100
101
}
101
102
103
+ [ Fact ]
104
+ public void CreateDefaultBuilder_RegistersApiExplorer ( )
105
+ {
106
+ var host = WebHost . CreateDefaultBuilder ( )
107
+ . Configure ( _ => { } )
108
+ . Build ( ) ;
109
+
110
+ var apiDescriptionProvider = host . Services . GetService ( typeof ( IApiDescriptionProvider ) ) ;
111
+ Assert . NotNull ( apiDescriptionProvider ) ;
112
+ }
113
+
102
114
[ Fact ]
103
115
public void CreateDefaultBuilder_RegistersEventSourceLogger ( )
104
116
{
You can’t perform that action at this time.
0 commit comments