I'm developing in vs2008, c#, .net 3.5.
I downloaded NUnit 2.5 win / msi version. I have created a [TestFixture] Class containing several [Test] methods.
How do I run the tests?
When I run a NUnit demo solution from Ed Ames, his test .cs files have an icon in the grey column to the left of the code (same place where breakpoints, bookmarks, etc show up.) Clicking on the icon gives me an option to run the tests.
That icon is not showing up in my projects. Is there a property I need to set?
Also, the documentation refers to a NUnit GUI that can be used to run the tests. A GUI doesnt seem to have downloaded in the msi version of NUnit. Is there a separate download for the Gui?
To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).
The SetUp attribute is inherited from any base class. Therefore, if a base class has defined a SetUp method, that method will be called before each test method in the derived class.
Thanks for all your help guys.
I am using resharper, forgot to mention it.
Actually, tests were not running (no tests found in file) because my [TestFixture] class was not Public. Changed it to Public and all my tests showed up.
Also, thanks for your help finding the Gui. I was looking for an exe with GUI in the filename. But I will use Resharper to run the tests. Now that I have found them!
The demo you saw most likely had a VS plug in (Resharper, TestDriven.NET, etc.), which doesn't come with NUnit. However, NUnit installs with a GUI. Go to the folder that you installed NUnit and you will find it there.
The program is called nunit.exe and it's in the bin folder.
Once you start it, you'll need to go to File -> Open Project and find the DLL you built in Visual Studio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With