• Increase font size
  • Default font size
  • Decrease font size
Home Articles Software Testing Test Automation Running NUnit tests from Team Foundation Server 2012 Continuous Integration Build

Running NUnit tests from Team Foundation Server 2012 Continuous Integration Build

E-mail Print PDF

In my previous post, I have explained how developers can take benefit of NUnit framework to develop and execute test cases in new Visual Studio 2012. This post is the next logic step to make those NUnit test cases run as part of a TFS build. This is more easily possible with new Test Runner that comes with Visual Studio which can handle execution of unit tests not only developed using Microsoft Unittest Framework but also other famous 3rd party unit test frameworks like NUnit, xUnit etc. Lets see how we can make TFS build execute NUnit based unit tests.


  1. If you have not, install the NUnit adapter for Visual Studio 2012 from Tools > Extensions menu

  2. Create a new folder in your team project source from Source Control Explorer, you can name it whatever suites -  I named it BuildFramework. Then add the NUnit dlls that you got as part of the extension install to this source location. You can find those typically under - C:\Users\<current user>\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\

  3. Now, let your build controller know that it has to consider some extra assemblies as part of build execution. This can be done by editing build controller properties. Go to Team explorer > Builds > Actions and Select Manage Build Controller. Then select the build controller and click on properties. On the build controller properties select the above created folder from source location containing NUnit assemblies as “Version control path to custom assemblies”

  4. That is it! Now next time you run your continuous build that is set to run “unit tests” will execute unit tests developed using NUnit framework alongside Visual Studio unit tests.


( 1 Vote )
ehuna 2013-01-04 08:11:05

I setup a TFS build service with one controller an d 8 agents on Windows 8 to be
able to automate bui lds for Windows Store apps.

This also works with hosted
TFS and my Windows 8 build server!

This is great, thank you!
Unable to run the Unit tests
Chandrahas 2013-07-31 19:24:18

I followed all the instructions mentioned in the p ost, but was unable to run th
e NUnit unit tests.
I always get this message when I open my build defi nition:

'No assemblies were found in the custom assembly path. The assemblies may no
t exist or you may not have permissions to read them. Contact yo ur Team Founda
tion Administrator for more informat ion.'

I have all the required permissions
enable d.
Any help/suggestion is appreciated
Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 . All rights reserved."

Last Updated on Friday, 19 June 2015 14:02  

Our valuable member Ajay Majgaonkar has been with us since Thursday, 23 April 2009.

Show Other Articles Of This Author

Software Testing



We have 10 guests online