Creating NUnit projects

Since version 2.1, both the Console runner and the GUI runner of NUnit can load tests from multiple test assemblies. The NUnit documentation contains more information about this feature. Still there can be one or more obstacles when you use multiple test assemblies.

Adhoc projects

The Console runner accepts more than one test assemblies as command line arguments. If you use the GUI runner you can add test assemblies by using “Project => Add Assembly…”. But the test assembly must be in the same directory as the assembly which has already been loaded, otherwise NUnit can’t find the file and aborts with a FileNotFoundException.

Creating NUnit projects

You can create a new NUnit test project by clicking on “File => New Project…”. You can add assemblies to the project by clicking on “Project => Add Assembly…”. Using NUnit test projects the test assemblies can be in different directories.

One configuration file for all test assemblies

NUnit can load configuration files for test assemblies even for class libraries. With NUnit test projects you can use just one configuration file. You can change the name of this file in the NUnit project editor, but you can’t specify a file path, just the file name. The configuration file must be located in the same directory as the project file.

Posted in Uncategorized | Leave a comment

RenderAction and SubControllers in ASP.NET MVC

Last week I watched some videos about ASP.NET MVC. Rob Conery creates in episode 11 of the “ASP.NET MVC Storefront” series an ASP.NET MVC Component. Using components you can call an action method of a ComponentController and insert the rendered result into the view. Mike Bosch explains this concept in a blog post.

In ASP.NET MVC Preview 4 ComponentController has been removed and the method RenderComponent which called the ComponentController action from the view has been replaced by the method RenderAction which can call an action of a normal Controller. Since this concept conflicts with “Separation of concerns“, Microsoft doesn’t intend to include this feature in the RTM version of ASP.NET MVC.

ASP.NET MVC Futures

Therefore the ASP.NET MVC team moved the RenderAction method to the ASP.NET MVC Futures which consist of the assembly Microsoft.Web.Mvc.dll. This assembly contains features and prototypes which haven’t been included in the RTM version yet. The release for ASP.NET MVC Beta 1 can be downloaded from Codeplex.

In order to use ASP.NET MVC Futures in your MVC project reference the assembly “Microsoft.Web.Mvc.dll” and insert the following line into the web.config to include the namespace “Microsoft.Web.Mvc” in all your views automatically:

SubControllers from MvcContrib

SubControllers can be used for similar purposes like RenderAction or Components. Matt Hinze presented this feature from the MvcContrib project in a blog post. SubController actions can be included in the view data as delegates. The views can then invoke these delegates and start the rendering of the SubController action view.

The host controller can pass objects to the SubController. Matt Hinze explains this feature in another blog post.

Technorati Tags , ,

Posted in .NET Development | Tagged , , | Leave a comment

RowTest Extension 1.2.3

I released a new version of the RowTest Extension. I made following changes:

  • The description of a Row attribute will be copied to the created test case.

You can download it from the RowTest Extension page.

Technorati Tags , , ,

Posted in .NET Development, TDD | Tagged , , , | Leave a comment

Detecting Testability Problems

Roy Osherove wrote a new tool, called Depender. It inspects the types within an assembly and tries to find possible testability problems and places where you can already use seams to inject your own implementation. If you’re not familiar with the concept of seams you might want to read Michael Feather’s book “Working Effectively with Legacy Code”.

You can extend Depender by writing your own dependency rules.

Technorati Tags , ,

Posted in .NET Development, TDD | Tagged , , | Leave a comment

NUnit 2.4.7 includes RowTest Extension

Charlie Poole released NUnit 2.4.7 today. This release eliminates some problems related to NUnit’s interaction with log4net and various bugs are also addressed. The release notes contain more detailed information.

RowTest Extension 1.2.2 is packaged in the NUnit extension assemblies. It’s the first time that an externally developed addin is included in a release of NUnit. You’ll have to change the namespace from [

]TlVuaXRFeHRlbnNpb24uUm93VGVzdA==[

] to [

]TlVuaXQuRnJhbWV3b3JrLkV4dGVuc2lvbnM=[

] if you want to port your unit tests from older versions of RowTest Extension.

You can download NUnit 2.4.7 from the NUnit site or from Sourceforge.

Technorati Tags , ,

Posted in .NET Development, TDD | Tagged , , | 4 Comments

RowTest Extension 1.2.2

I released a new version of the RowTest Extension. I made following changes:

  • null cannot be used as argument on .NET Framework 1.1. A new enum value SpecialValue.Null can be used instead. If the RowTest addin finds this value as argument the value will be translated to null.
  • Fixed Bug: Common NUnit attributes like Category, Description etc. don’t work for RowTest methods.

You can download it from the RowTest Extension page.

Technorati Tags , , ,

Posted in .NET Development, TDD | Tagged , , , | Leave a comment

Using Bazaar and Launchpad on Windows

Bazaar is a distributed version control system (DVCS) written in Python with many interesting features. Like all DVCS it supports disconnected operation which means that you don’t have to be connected to a central repository to commit changes or to view the history.

Launchpad is a free software hosting and development site. Another well-known site of this category is Sourceforge. Launchpad was originally created for Ubuntu and is now used by many other open source projects, e.g. Zope and Silva CMS.

Erik Thomson wrote some tips about using Launchpad and Bazaar on Windows and made a video tutorial.

When I tried to make a first branch at Launchpad on Windows I had some problems, though. I got errors like “bzr: ERROR: Don’t know how to handle SSH connections. Please set BZR_SSH environment variable.” or “bzr: ERROR: [Error 2] The system cannot find the file specified”. To push changes from the local branch to Launchpad Bazaar needs the python library paramiko for SSH connections and it were missing on my system. Paramiko requires pycrypto, binaries for Windows can be found at The Voidspace Python Modules. To install paramiko install pycrypto first, extract the downloaded zip package, change to the directory and call “&path to python&\python setup.py install”.

After installing the missing libraries everything worked fine and you can find a branch for the RowTest extension for NUnit at Launchpad.

Technorati Tags ,

Posted in VCS | Tagged , | Leave a comment