Does not work with MVC 4 default project

Sep 3, 2012 at 6:16 AM

In the template MVC 4 project there is no longer a MyApplication.RegisterRoutes method, rather routes are registered in RouteConfig.RegisterRoutes.

The RouteTester constructor looks for the presence of the RegisterRoutes method and calls it to initialise the registrations. When the method is not found all the tests fail. There is a workaround which is of course to add the RegisterRoutes method back in for MVC 4 projects, but this is not ideal.

Really the constructor should now also check for RouteConfig.RegisterRoutes and call that if found, otherwise unfortunately this package won't get much take up with MVC4.

Jan 23, 2013 at 3:08 PM

Yes I agree. Should be updated for MVC4.

Fantastic tool, but this is becoming a pain as it has added complexity to our already messy Global.asax.

Jan 23, 2013 at 5:17 PM

There is a fork which solves this problem perfectly:


Download it, compile it in release mode, and replace the original dll/xml files with the ones you've compiled. Hopefully Lee will accept the pull request and update the nuget package as well!

Oct 7, 2014 at 11:25 PM
Edited Oct 7, 2014 at 11:26 PM
wouldn't this work ? I am using MVC 5 and this project (mvcrouteunittester) works
            RouteCollection routes = new RouteCollection();
            RouteTester tester = new RouteTester(routes);
Oct 23, 2014 at 2:42 PM
@parmanes7 That worked for me. But how would you do it for Areas?