Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running XUnit.Net tests from Main Method / Within MonoDevelop

I am trying to use xUnit.net to test a project I wrote in Mono on OSX. I wannt good way to run the tests in MonoDevelop or at least a way to create a test suite and run these tests from a main method of the project. Has anyone tried doing this? I remember in NUnit I would be able to create test suites and run them myself but I am not able to figure out how to do the equivalent in xUnit.net.

Let me know if anyone has found a good way to run tests without using a runner in xUnit.net or a better way to run tests in OSX MonoDevelop.

like image 821
Sai Venkat Avatar asked Jul 30 '26 02:07

Sai Venkat


1 Answers

You can run your tests using xunit gui (use mono xunit.gui.flavor from terminal) - I'm not aware of an xunit addin for MonoDevelop that could integrate an xunit test runner into the MonoDevelop IDE (another reference: http://xunit.codeplex.com/discussions/439410).

To debug your unit tests, you can attach the debugger to the xunit gui. To make this simpler, you can customize the projects run configuration: http://www.grumpydev.com/2011/06/30/debugging-xunit-tests-using-monodevelop/

It's a decision you have to make whether you want to jump through a few hoops to use xunit or just use NUnit that's integrated well with the platform.

like image 125
Johannes Rudolph Avatar answered Aug 01 '26 18:08

Johannes Rudolph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!