A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Sunday, July 27, 2008

ASP.NET MVC Tip #25 - Unit Test Your Views without a Web Server

In this tip, I demonstrate how you can unit test ASP.NET MVC views without running a Web server. I show you how to unit test views by creating a custom MVC View Engine and a fake Controller Context. The more of your web application that you can test, the more confident that you can be that changes to your application won’t introduce bugs. ASP.NET MVC makes it easy to create unit tests for your models and controllers. In this tip, I explain how you also can unit test your views. Creating a Custom View Engine Let’s start by creating a custom View Engine. Listing 1 contains the code for a really simple View Engine named, appropriately enough, the SimpleViewEngine. Listing 1 – SimpleViewEngine.vb (VB.NET) Imports System Imports...(read more)

Source Click Here.

No comments:

Post a Comment

Post your comments here:

Originals Enjoy