File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Http/Routing/test/UnitTests Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,15 @@ public void ThrowOnBadRequestIsNotOverwrittenIfNotInDevelopmentEnvironment()
55
55
}
56
56
57
57
[ Fact ]
58
- public void RouteHandlerOptionsFailsToResolveWithoutHostEnvironment ( )
58
+ public void RouteHandlerOptionsCanResolveWithoutHostEnvironment ( )
59
59
{
60
60
var services = new ServiceCollection ( ) ;
61
61
services . AddOptions ( ) ;
62
62
services . AddRouting ( ) ;
63
63
var serviceProvider = services . BuildServiceProvider ( ) ;
64
64
65
- Assert . Throws < InvalidOperationException > ( ( ) => serviceProvider . GetRequiredService < IOptions < RouteHandlerOptions > > ( ) ) ;
65
+ var options = serviceProvider . GetRequiredService < IOptions < RouteHandlerOptions > > ( ) ;
66
+ Assert . False ( options . Value . ThrowOnBadRequest ) ;
66
67
}
67
68
68
69
private class HostEnvironment : IHostEnvironment
Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ public async Task RewriteAfterUseRoutingHitsOriginalEndpoint()
668
668
669
669
var response = await server . CreateClient ( ) . GetStringAsync ( "foo" ) ;
670
670
671
- Assert . Equal ( "/foo HTTP: GET from /foos" , response ) ;
671
+ Assert . Equal ( "HTTP: GET /foo from /foos" , response ) ;
672
672
}
673
673
674
674
[ Fact ]
Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ internal static bool IsCompilerGeneratedType(Type? type = null)
33
33
/// </summary>
34
34
/// <param name="method">The method to evaluate.</param>
35
35
/// <returns><see langword="true" /> if <paramref name="method"/> is compiler generated.</returns>
36
- internal static bool IsCompilerGeneratedMethod ( MethodInfo method )
36
+ private static bool IsCompilerGeneratedMethod ( MethodInfo method )
37
37
{
38
38
return Attribute . IsDefined ( method , typeof ( CompilerGeneratedAttribute ) ) || IsCompilerGeneratedType ( method . DeclaringType ) ;
39
39
}
40
40
41
41
/// <summary>
42
- /// Tries to get non-compiler-generaged name of function. This parses generated local function names out of a generated method name if possible.
42
+ /// Tries to get non-compiler-generated name of function. This parses generated local function names out of a generated method name if possible.
43
43
/// </summary>
44
44
internal static bool TryGetNonCompilerGeneratedMethodName ( MethodInfo method , [ NotNullWhen ( true ) ] out string ? originalName )
45
45
{
You can’t perform that action at this time.
0 commit comments