Skip to content

Commit 8426c40

Browse files
committed
Fix tests and address PR feedback
- No. I do not think normalizing the display names is a breaking change.
1 parent 2cf9066 commit 8426c40

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Http/Routing/test/UnitTests/RouteHandlerOptionsTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ public void ThrowOnBadRequestIsNotOverwrittenIfNotInDevelopmentEnvironment()
5555
}
5656

5757
[Fact]
58-
public void RouteHandlerOptionsFailsToResolveWithoutHostEnvironment()
58+
public void RouteHandlerOptionsCanResolveWithoutHostEnvironment()
5959
{
6060
var services = new ServiceCollection();
6161
services.AddOptions();
6262
services.AddRouting();
6363
var serviceProvider = services.BuildServiceProvider();
6464

65-
Assert.Throws<InvalidOperationException>(() => serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>());
65+
var options = serviceProvider.GetRequiredService<IOptions<RouteHandlerOptions>>();
66+
Assert.False(options.Value.ThrowOnBadRequest);
6667
}
6768

6869
private class HostEnvironment : IHostEnvironment

src/Middleware/Rewrite/test/MiddlewareTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ public async Task RewriteAfterUseRoutingHitsOriginalEndpoint()
668668

669669
var response = await server.CreateClient().GetStringAsync("foo");
670670

671-
Assert.Equal("/foo HTTP: GET from /foos", response);
671+
Assert.Equal("HTTP: GET /foo from /foos", response);
672672
}
673673

674674
[Fact]

src/Shared/RoslynUtils/TypeHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ internal static bool IsCompilerGeneratedType(Type? type = null)
3333
/// </summary>
3434
/// <param name="method">The method to evaluate.</param>
3535
/// <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)
3737
{
3838
return Attribute.IsDefined(method, typeof(CompilerGeneratedAttribute)) || IsCompilerGeneratedType(method.DeclaringType);
3939
}
4040

4141
/// <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.
4343
/// </summary>
4444
internal static bool TryGetNonCompilerGeneratedMethodName(MethodInfo method, [NotNullWhen(true)] out string? originalName)
4545
{

0 commit comments

Comments
 (0)