51

I'm cheap and don't want to pay for ReSharper or TestDriven.NET, is there a free visual Studio addin for NUnit?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Eric Labashosky
  • 29,484
  • 14
  • 39
  • 32

9 Answers9

60

You can create a blank project (Choose console application for example) and in the property of the project you can select DEBUG tag and select "Start External Program". Put the path of Nunit. Then, in the start option, the command line arguments select the DLL that contains all your tests (mine is always in the nunit\bin...). Then select "enable unmanaged code debugging" and you will be able to start the project inside VS and even use the debugger step-by-step.

This is a free solution.

Bruno
  • 533
  • 1
  • 6
  • 27
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
  • 14
    +1 [I've provided a step-by-step guide with images](http://erraticdev.blogspot.com/2012/01/running-or-debugging-nunit-tests-from.html) of how to do what you described. I'm also using NUnit this way. It also makes it possible to **debug your tests* if you need to. – Robert Koritnik Jan 11 '12 at 08:03
10

Now you can use Gallio: it's open source. www.gallio.org

John Sheehan
  • 77,456
  • 30
  • 160
  • 194
ema
  • 5,668
  • 1
  • 25
  • 31
7

By the way TestDriven can be downloaded for free if it's for personal use or Open Source project.

I had to find a way to use .Net Reflector inside VS few days ago and when I downloaded TestDriven it cames with. Never got any popup asking me to paid.

Community
  • 1
  • 1
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
5

NUnit actually ships with a basic integrated runner. It's not very good, and not very publicized, but unless Charlie has taken it out, it should be in the source.

Cory Foy
  • 7,202
  • 4
  • 31
  • 34
5

I know this is an old question but another way to do this is to add an external tool from the tools menu to run nunit - set the arguments to be $(TargetName)$(TargetExt) and initial directory to $(ProjectDir)\bin\Debug

check out this link

Adam Butler
  • 3,023
  • 5
  • 35
  • 40
2

If you're running Visual Studio 2012, there is a plugin written by Charlie Poole, one of the NUnit contributers, that makes use of the new Visual Studio Unit testing plugins.

Unfortunately it doesn't have much grouping options yet, either by run/not run - so you can't group by class, solution and so on. It also doesn't show you any stacktrace if a test fails, just a simple green tick or red box and a message.

img

Chris S
  • 64,770
  • 52
  • 221
  • 239
2

This is an old question and things have changed since the answer was accepted.


You may try NCrunch to run tests automatically or manually.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • One thing to note is that NCrunch appears to be in beta at the moment. Their website hints that it is free "while it's in beta" which leads me to believe it may become a paid app at some point. – Joe Phillips May 21 '12 at 02:28
  • 5
    And now NCrunch is out of beta and is no longer free. – Joe Phillips Oct 30 '12 at 03:04
0

I haven't used it, but NUnitit is a free Visual Studio Add-in for NUnit.

http://nunitit.codeplex.com

From my experience, the best add-in for visual studio is resharper. TestDriven.Net is also good for unit tests. Hope that helps

  • It definitely doesn't help for you to recommend the two products that the questioner specifically said he didn't want to pay for. Hope this helps. – jwg Mar 21 '13 at 11:32
0

Also found this one : http://visualstudiogallery.msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099
It is able to launch your tests in debugger, however you need to recompile the code manually each time you change something - no auto run-build integration

Cyryl Płotnicki
  • 473
  • 6
  • 12