Mocking ASP.NET MVC HtmlHelper using Moq (blog.benhartonline.com)
submitted by
benhart(100) 1 year, 3 months ago
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.
|
category: ASP.NET
|
Views: 140
tags:
ASPNETMVC Moq ASP.NET MVC another
Everyones tags:
Your Tags: