Thursday May 5th

Wednesday May 4th

1 Kicks

Mocking ASP.NET MVC HtmlHelper using Moq

HtmlHelper is used quite frequently in ASP.MVC. It has a number of dependencies, so testing the numerous extension methods on it (both default, and added) can make for some ugly code. This simple code sample shows how to mock out the dependencies (ViewContext for one) using Moq.


Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network