Urls for menus in my ASP.NET MVC apps are generated from controller/actions. So, they call
controller.Url.Action(action, controller)
Now, h
Here is another way to solve the problem with NSubstitute. Hope, it helps someone.
// _accountController is the controller that we try to test var urlHelper = Substitute.For(); urlHelper.Action(Arg.Any(), Arg.Any()).Returns("/test_Controller/test_action"); var context = Substitute.For(); _accountController.Url = urlHelper; _accountController.ControllerContext = new ControllerContext(context, new RouteData(), _accountController);