diff --git a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs index facb4e07e1..d6931df173 100644 --- a/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Core.Test/Routing/EndpointRoutingUrlHelperTest.cs @@ -142,12 +142,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing string template) { var endpoints = GetDefaultEndpoints(); - endpoints.Add(new RouteEndpoint( - httpContext => Task.CompletedTask, - RoutePatternFactory.Parse(template), - 0, - EndpointMetadataCollection.Empty, - null)); + endpoints.Add(CreateEndpoint(template, routeName: routeName)); return CreateUrlHelper(endpoints, appRoot, host, protocol); } @@ -181,7 +176,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing string template, object defaults) { - var endpoint = GetEndpoint(routeName, template, new RouteValueDictionary(defaults)); + var endpoint = CreateEndpoint(template, new RouteValueDictionary(defaults), routeName: routeName); var services = CreateServices(new[] { endpoint }); var httpContext = CreateHttpContext(services, appRoot: "", host: null, protocol: null); var actionContext = CreateActionContext(httpContext); @@ -262,13 +257,6 @@ namespace Microsoft.AspNetCore.Mvc.Routing requiredValues: new { controller = "home", action = "contact" }, order: 8, routeName: "namedroute")); - endpoints.Add( - CreateEndpoint( - "any/url", - defaults: new { }, - requiredValues: new { }, - order: 9, - routeName: "MyRouteName")); endpoints.Add( CreateEndpoint( "api/orders/{id}", @@ -315,15 +303,5 @@ namespace Microsoft.AspNetCore.Mvc.Routing services.TryAddSingleton(); return services.BuildServiceProvider(); } - - private RouteEndpoint GetEndpoint(string name, string template, RouteValueDictionary defaults) - { - return new RouteEndpoint( - c => Task.CompletedTask, - RoutePatternFactory.Parse(template, defaults, parameterPolicies: null), - 0, - EndpointMetadataCollection.Empty, - null); - } } }