diff options
Diffstat (limited to 'src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs')
-rw-r--r-- | src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs b/src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs index 4982b8d8b6..8c234537a3 100644 --- a/src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs +++ b/src/Http/Routing/test/UnitTests/TestObjects/TestMatcher.cs @@ -6,26 +6,25 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Routing.Matching; -namespace Microsoft.AspNetCore.Routing.TestObjects +namespace Microsoft.AspNetCore.Routing.TestObjects; + +internal class TestMatcher : Matcher { - internal class TestMatcher : Matcher + private readonly bool _isHandled; + + public TestMatcher(bool isHandled) { - private readonly bool _isHandled; + _isHandled = isHandled; + } - public TestMatcher(bool isHandled) + public override Task MatchAsync(HttpContext httpContext) + { + if (_isHandled) { - _isHandled = isHandled; + httpContext.Request.RouteValues = new RouteValueDictionary(new { controller = "Home", action = "Index" }); + httpContext.SetEndpoint(new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "Test endpoint")); } - public override Task MatchAsync(HttpContext httpContext) - { - if (_isHandled) - { - httpContext.Request.RouteValues = new RouteValueDictionary(new { controller = "Home", action = "Index" }); - httpContext.SetEndpoint(new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "Test endpoint")); - } - - return Task.CompletedTask; - } + return Task.CompletedTask; } } |