This project is read-only.


Jan 23, 2015 at 3:15 PM

I have a cshtml file with a call to @Html.RouteLink passing as a second parameter the name of the route.

I'm having an exception in my test because the route name cannot be found in the route collection. I'm trying to set the route collection in the view using:
var mockViewContext = new Mock<ViewContext>();
            var mockViewDataContainer = new Mock<IViewDataContainer>();
            mockViewDataContainer.Setup(vdc => vdc.ViewData).Returns(new ViewDataDictionary());

            var routeCollection = new RouteCollection();

            var details = new Details();
            details.Html = new HtmlHelper<VacancyDetailViewModel>(mockViewContext.Object, mockViewDataContainer.Object, routeCollection);
But it doesn't works.

How can I deal with this problem?

Thank you very much,
Jan 23, 2015 at 5:54 PM

I have a pull request prepared to solve this problem. Please, can you tell me how can I do it?

Jan 23, 2015 at 6:39 PM

I've sent you the pull request. Well, actually I've sent you two pull request. I added a unit test in the second one.

Thank you very much!
Jan 27, 2015 at 11:37 PM
Your change is in, thanks.
Jan 28, 2015 at 9:16 AM
Thank you David!