What about unit testing Web Api routes?

Sep 10, 2014 at 4:59 PM
If I try to call

config.Routes.MapHttpRoute(
            name: "DefaultApi",
            routeTemplate: "api/{controller}/{id}",
            defaults: new { id = RouteParameter.Optional }
        );
from MvcApplication.RegisterRoutes, the unit test throws:

This method cannot be called during the application's pre-start initialization phase