36

I have a solution already containing a library with NUnit tests. When I develop with Visual Studio, I normally run these tests with the nunit.exe binaries I have included in a tools\nunit folder in my project.

I'm now developing the same solution with monodevelop. I'm pretty sure I remember that there was an integrated "run tests" action in monodevelop, and I would like to use this to run the tests. According to this article there should be a "View - Unit Tests" menu item. However, I must be doing something wrong/special because I can't find it.

How do I run my NUnit tests with Monodevelop?

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
  • Please check which MonoDevelop version are you running. 2.6 doesn't exist, the latest release is 2.4.1. Also, which operating system are you using? – Lluis Sanchez Dec 03 '10 at 09:52
  • @Lluis: I must have confused the version of Monodevelop with the version of Mono, I was pretty tired last night when I posted this question. The platform is Ubuntu 10.04 but I might have installed a more recent Monodevelop package from somewhere else, or perhaps even compiled from source. I'll check again later today and will provide more details. – Wim Coenen Dec 03 '10 at 10:08

4 Answers4

32

Try this:

sudo apt-get install monodevelop-nunit
head_thrash
  • 1,623
  • 1
  • 21
  • 26
  • The saddest thing:`Support for NUnit 3 was added in: Xamarin Studio 6.0.0.4514` (from https://bugzilla.xamarin.com/show_bug.cgi?id=35915) I am on Linux Mint, and there still Monodevelop **5.x** – maxkoryukov Jan 13 '17 at 20:16
29

If you are using Ubuntu, make sure you have the MonoDevelop NUnit plugin installed through the package manager. Once you have it, click on "View -> Pads -> Unit Tests". The unit tests pad will be shown and then you can run test fixtures by double clicking on them.

Lluis Sanchez
  • 1,737
  • 10
  • 11
11

To summarise the answers so far:

  1. sudo apt-get install monodevelop-nunit
  2. Select menu item: View | Pads | Unit Tests

Tested with clean installs of Ubuntu 12.04 and MonoDevelop 2.8.6.3.

Thomas Bratt
  • 48,038
  • 36
  • 121
  • 139
2

I don't recall that there is a "run tests" action built-in mono develop. But there is an add-in you can use.

Enabling the NUnit Add-in

The NUnit addin requires mono 1.1.9+. This is do to some cross-appdomain bug fixes. Debian users currently also have another particular problem in that NUnit packages are separated from Mono, and do not include the proper pkg-config files.

Configure monodevelop with the following command.

./configure --enable-nunit 

Debian users only

Install the nunit and libnunit-cil packages (requires unstable at this moment). Due to the separate packaging of nunit, we need to make a symlink so that monodevelop knows where to find the pkg-config file.

ln -s /usr/lib/pkgconfig/nunit.pc /usr/lib/pkgconfig/mono-nunit.pc

EDIT: I found some more info here: http://www.codeproject.com/KB/tips/NUnit_MonoDevelop.aspx. If it doesn't help, I might try it tomorrow on my mono develop, what platform are you using?

Kel
  • 1,217
  • 11
  • 21