Monday, August 20, 2007

Nunit + MSBuild


I wanted to run the test cases for my libraries as a part of building them, so I will make sure every time I have to build the libraries that they are functioning correctly.


Unfortunatly, the built-in tasks will not do that be default; the option here is to call the nunit-console using the


Then doing a simple google search, I found MSBuildCommunityTasks.


MSBuild Community Tasks Project is an open source project for some missing and useful tasks, one of them is the Nunit task.


After I got the installer,I tried to find the documentation and see how to use the Nunit task, but I haven't seen any example on how to use it.


Try and Error; this is the last resort, but I also got some information by looking into the source code of the Nunit task itself to know how to allow the task to find the nunit-console.exe.


I followed the following steps to actually get my Nunit test cases to run during my build.


1 - import the MSBuild.Community.Tasks.Targets files:



2 - Copy the Nunit\bin directory to my source code folder tree under a top level folder; example:







3 - Created a property in the Msbuild script to hold the relative path to nunit binaries







4 - My library and its tests are part of the same solution, so the MSBuild task <<MSBuild> will build the library and the tests at the sametime.






5 - Then come the play with Nunit task to actually run the test cases:








Notice that:

I had to set the DisableShadowCopy="true" to run the tests in their original location and instruct nunit-console not to make a copy in a temp folder


6 - I liked to organize a little bit, so I have created 2 targets; one for the build and one for the test, then a single target to call them both; which makes my build script looks like this:






<Project xmlns="" DefaultTargets="BuildAll" >


<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>








<Target Name="BuildAll" DependsOnTargets="MyLibrary;MyLibrary-Test">



<Target Name="MyLibrary">

<MSBuild Projects="MyLibrary.sln" Targets="Build" />




<Target Name="MyLibrary-Test">












Monday, August 13, 2007

ITWorx wins Microsoft's 2007 Partner of the Year Award

ITWorx , one of the largest software professional services firms in the region, and Microsoft Gold Certified Partner, has received yet another award to add to its portfolio, winning '2007 Microsoft Custom Development Solutions Partner of the Year, Web Development', at the Microsoft Worldwide Partner Conference on July 11th in Denver, Colorado.

More info:

Go Worx Go