Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steps to run NUnit tests on OSX

How do I run NUnit tests developed within VS2010 on a Mac? This seems like a very simple and naive question but I have been struggling to find all the steps. I have done my due diligence by scouring the web to find the exact steps. I have Mono on my Mac, but not monodevelop. How can i install NUnit on a Mac without mono develop? Do I need to add all the NUnit related dlls manually to Mono GAC or something?

like image 753
RashMans Avatar asked Oct 10 '22 22:10

RashMans


1 Answers

No need to have monodevelop. After getting nunit you can just call it via (for instance)

mono nunit-console.exe your.dll

You can also do this using only binaries downloaded from nunit site, just be in the nunit's directory.

If there is no package for OS X, you can install it by making script invoking nunit (this is how standard nunit install on Linux works) and putting it in your search path. Adding assemblies to GAC is not necessary as long as they are with exe's.

For example this is nunit-console script on Ubuntu (which can be usually found in /usr/bin):

#!/bin/sh
exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/2.0/nunit-console.exe "$@"

Of course you should replace /usr/lib/mono/2.0/ with directory which contains nunit.

like image 90
konrad.kruczynski Avatar answered Oct 13 '22 10:10

konrad.kruczynski