Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Unassigned: UrlHelper class in Web API is hard to mock [977]

$
0
0
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
Comments: This is already fixed. See the spec at https://aspnetwebstack.codeplex.com/wikipage?title=Improving%20ApiController%20testability&referringTitle=Specs and the commit that fixed it at https://aspnetwebstack.codeplex.com/SourceControl/changeset/522ca1b4013566990732bc1cb96f5ac469c24596

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>