I need to get RoutData
by given URL string in ASP.NET MVC application.
I\'ve found the way that I need to mock HttpContextBase
based on my
This works for me (.NET 4.5, MVC 5): https://average-joe.info/url-to-route-data/
System.Web.Routing.RouteData routeFromUrl =
System.Web.Routing.RouteTable.Routes.GetRouteData(
new HttpContextWrapper(
new HttpContext(
new HttpRequest(null, path, query),
new HttpResponse(new System.IO.StringWriter()))));