I created NUnit tests, now how to run them?

I am developing vs2008, C #,. Net 3.5.

I downloaded NUnit 2.5 win / msi version. I created the [TestFixture] class containing several [Test] methods.

How to run tests?

When I run the NUnit demo solution from Ed Ames, its test .cs files have an icon in the gray column to the left of the code (in the same place as breakpoints, bookmarks, etc.). Clicking on the icon gives me the option I need to run the tests.

This icon does not appear in my projects. Is there a property that I need to set?

In addition, the documentation refers to the NUnit GUI, which you can use to run tests. The GUI does not seem to be loaded into the NInit version. Is there a separate download for Gui?

+6
unit-testing nunit bdd
source share
5 answers

Thank you all for your help.

I use resharper, forgot to mention it.

In fact, the tests were not performed (no tests were found in the file), because the [TestFixture] class was not publicly available. Changed it in Public and all my tests appeared.

Also, thanks for helping me find Gui. I searched exe with GUI in file name. But I will use Resharper to run the tests. Now that I have found them!

+9
source share

The demo that you saw most likely had a VS plug-in (Resharper, TestDriven.NET, etc.) that did not ship with NUnit. However, NUnit is installed using a graphical interface. Go to the folder where NUnit is installed and you will find it there.

The program is called nunit.exe and it is located in the bin folder.

Once you run it, you need to go to File -> Open Project and find the DLL created in Visual Studio

+2
source share

You can use the nUnit runner (GUI is nunit.exe in the bin folder, Console is nunit-console-x86.exe), which comes with nUnit, I believe.

Alternatively, if you have a resharper ( http://www.jetbrains.com/resharper/ ), it has a test runner.

There is also TestDriven.Net ( http://www.testdriven.net/ )

+1
source share

I have not seen this demo, but it sounds very similar to the fact that it uses Resharper .

If you started the msi installer, it installed the NUnit GUI runner. If you are looking at the Start menu, then this is possible in the "Programs → Nunit" section. From the GUI runner, you can download the test build by going to the bin directory of your project.

+1
source share

You need to open the dll using 1) the Nunit command line or 2) the Nunit GUI

0
source share

All Articles