.NET TDD Roundup #1

This is .NET TDD roundup #1.

The .NET TDD roundup aggregates information of interest to .NET developers using TDD/BDD. If you have something interesting you have done or have run across, please send me the URL with a brief description via the contact link on my blog.
Read More »

Technorati Tags

Kick It on DotNetKicks.com
Posted in .NET Development, TDD | Tagged | Leave a comment

When Is a Test a Unit Test?

Developers write their tests usually with a unit test framework. Often those tests are slow and unreadable. Almost always the tests communicate with a database, a file system, a web service or other external resources. Developers stop executing the tests regularly and further they stop writing tests entirely, because “unit tests” are so slow and hard to maintain.

Michael Feathers has already summarized the criteria for unit tests in September 2005:

“A test is not a unit test if:

  • It talks to the database
  • It communicates across the network
  • It touches the file system
  • It can’t run at the same time as any of your other unit tests
  • You have to do special things to your environment (such as editing config files) to run it.

Tests that do these things aren’t bad. Often they are worth writing, and they can be written in a unit test harness. However, it is important to be able to separate them from true unit tests so that we can keep a set of tests that we can run fast whenever we make our changes.”

Developers often even do not write unit tests! They are writing integration tests instead. Sometimes it takes more than knowing the test attributes of the used unit test framework to write real unit tests!

Technorati Tags ,

Kick It on DotNetKicks.com
Posted in .NET Development, Software Development, TDD | Tagged , | 1 Comment

Windows Installer 4.5 SDK no longer available as stand-alone download

Windows SDK for Windows 7 and .NET Framework 3.5 SP1 is now available to download. It includes the latest SDK for Windows Installer 5.0. Therefore the stand-alone version of the Windows Installer 4.5 SDK is no longer available for download.

Kick It on DotNetKicks.com
Posted in .NET Development, Software Development | Leave a comment

Resources for Setup Authors

In the last years I created Windows Installer packages (MSI files) using various tools. Now I’m working on the installer for NUnit 3 and we’re using Windows Installer XML (WiX) version 3.

I’m writing this post to collect links to interesting resources for creating setups using WiX.

For getting started with WiX:

Technorati Tags , , ,

Kick It on DotNetKicks.com
Posted in .NET Development | Tagged , , , | Leave a comment

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.

Kick It on DotNetKicks.com
Posted in .NET Development | 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 , ,

Kick It on DotNetKicks.com
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 , , ,

Kick It on DotNetKicks.com
Posted in .NET Development, TDD | Tagged , , , | Leave a comment