WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 212 users


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

Blogger : ASP.NET Team Blogs
All posts : All posts by ASP.NET Team Blogs
Category : ASP.NET
Blogged date : 2008 Jul 26

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)

Read comments or post a reply to : ASP.NET MVC Tip #25 – Unit Test Your Views without a Web Server
Page 389 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card