ASP.NET MVC Preview 2 Brings Out Many Value Additions
The ASP.NET MVC Framework Preview 2 has been released last week and offers a lot of new features and many refactorings.
A very important point to note is that the framework has been separated from the ASP.NET Extensions/Futures package, and is now available as an individual download. This clearly shows the rising interest in and importance of the MVC Framework.
He has also written about the ASP.NET MVC Test Framework Integration that supports unit testing within web applications:
If you have Visual Studio Unit Test framework on your machine (i.e. in Visual Studio 2008 SKUs Professional and Above) then on creation of ASP.NET MVC Web Application you will automatically be prompted to create a test project. Not only that, due to the popular community request Visual Studio will now also provide a mechanism to extend this test framework system to integrate external unit testing frameworks like NUnit, MBUnit, xUnit etc.
Currently the Visual Studio integration contains project templates for MSTest only. Vishal shows how to write a template that supports the NUnit framework and the Rhino.Mocks library. Joe Cartano provides an implementation of Vishals guidance as part of his ASP.NET MVC Test Framework Integration Walkthrough as well as an overview of the ASP.NET MVC Framework Preview 2 (Mix 2008) Resources.
If you are new to the ASP.NET MVC framework, you might have a look at Scott Hanselman's series of screencasts on the topic. These screencast provide a nice introduction based on the current MIX08 release:
- Displaying Data
This screencast is about how data gets displayed in ASP.NET MVC. One of the changes is support for a wide variety of test frameworks You might create a test project from the ASP.MVC Web App template within Visual Studio.
- Editing Data and Making Forms
Scott shows how to edit data within HTML forms. In addition he shows three different options of inserting links to controller actions and how to create and use MVC User Controls.
- Advanced Techniques
Some of the advanced techniques of ASP.NET MVC are described within this screencast. Scott introduces action filters, which are attributes that add pre and post processing logic to controller actions. He also shows how to integrate and create custom view engines and custom controllers. At last he explains catch all routes that grab everything from the wildcard '*' to the end of the request URI and transform it into a named parameter value.
The last part of the series is about testing ASP.NET MVC applications and especially about mocking certain aspects of web application development. Scott talks about MvcMockHelpers, which is not part of the MVC bundle, yet. This static class helps to make mocking a lot easier in ASP.NET MVC applications.
Todd Montgomery Dec 19, 2014
Juergen Hoeller,Stéphane Nicoll Dec 18, 2014