1

Closed

UrlHelper class in Web API is hard to mock

description

None of the methods are virtual making it hard to mock and hence test. It would be great if these could be made virtual:
    public string Link(string routeName, IDictionary<string, object> routeValues);
    public string Link(string routeName, object routeValues);
    public string Route(string routeName, IDictionary<string, object> routeValues);
    public string Route(string routeName, object routeValues);
Thanks

Henrik
Closed Apr 10, 2013 at 9:57 PM by eilonlipton
This is now fixed in the nightly builds.

comments

HenrikN wrote Apr 9, 2013 at 2:44 PM

It also needs a default constructor.