Wednesday, January 14, 2009

Unit testing DotNetNuke projects just became easier

Unit testing DotNetNuke projects is hard. A typical DNN module is an ASP.NET Web Application Project that includes all the normal WebForms dependencies + DotNetNuke specific dependencies. Visual Basic is more common than C#. DotNetNuke project team has put a considerable effort to make the latest release of the framework more testable, but there are still a number of roadblocks. Charles Nurse of the core team has posted a good series on creating testable modules for DNN based on the Model-View-Presenter pattern.

However, not everyone has the luxury of rearchitecting their webapps to a more testable design. If unit testing WebForms is hard, unit testing legacy WebForms is downright painful. Unless, you can somehow create tests without changing existing code. This is where mock objects come in. Traditional mocking relies in interfaces that you hand-code for the objects you want to mock. This process can hardly be justified in itself, it is more like a tax to be paid to get unit tests in place. A more flexible mock system such as TypeMock Isolator does not require such effort. Unfortunately, TypeMock has not been too useful to DNN developers because it has not supported VB. Until now, that is.

With TypeMock 5.2 here, there is a new power tool to help DNN developers create testable and more maintainable code. It costs money, but in any serious work your time will cost many times more. I don't know yet if TypeMock will save enough time to justify its cost, but it has certainly raised high hopes.

For more information, check the (yet) unpaid ad below ;) 

-mika-

[Update: I received a free licence in January 21st. After I have played around, a review post will follow. Thank you!!! ]

*Begin*

Typemock have released a new version of their unit testing tool, Typemock Isolator 5.2.
This version includes a new friendly VB.NET API which makes Isolator the best Isolation tool for unit testing A Visual Basic (VB) .NET application.
Isolator now allows unit testing in VB or C# for many ‘hard to test’ technologies such as SharePoint, ASP.NET MVC, partial support for Silverlight, WPF, LINQ, WF, Entity Framework, WCF unit testing and more.

Note that the first 25 bloggers who blog this text in their blog and tell us about it, will get a Free Full Isolator license (C#, VB, and Sharepoint included - worth $139 !!!). If you post this in a VB.NET dedicated blog, you'll get a license automatically (even if more than 25 submit) during the first week of this announcement.

Go ahead, click the following link for more information on how to get your free license.
_
*End*

0 comments: