Code coverage and debugging support for NUnit C# code

Ask general questions about the Ranorex certification here.
hellboy81
Posts: 22
Joined: Sun Dec 10, 2017 8:52 pm

Code coverage and debugging support for NUnit C# code

Post by hellboy81 » Tue Feb 06, 2018 11:37 am

I try to write unit tests for my own test framework in Ranorex Studio (RS).

As I mentioned Unit testing addin is in RS is disabled by developer (Ranorex)

The solution to run NUnit Tests works for me also with standard delivered NuGet Version:

Code: Select all

Install-Package NUnit.Runners -Version 2.6.4 # The only NuGet Package you need .
My unit tests (for own framework) can be recognized and executed by standard NUnit GUI Runner (nunit-x86.exe):

Is there possible to collect and to show code coverage info (may be also in Ranorex Studio using CodeCoverage Addin)?
Last edited by hellboy81 on Tue Apr 10, 2018 9:45 am, edited 1 time in total.

hellboy81
Posts: 22
Joined: Sun Dec 10, 2017 8:52 pm

Re: Code coverage and debugging support for NUnit C# code

Post by hellboy81 » Tue Apr 10, 2018 9:17 am

If I try to debug NUnit test using Ranorex Studio I got

Code: Select all

Can not start process. The directory name is invalid. (Exception from HRESULT: 0x8007010B)
Trying to run tests without debugging and code coverage. Got:
Unable to run unit tests. The file '{0}' cannot be found.
from SharpDevelop

At the moment unit tests can be executed only from NUnit GUI Test Runner manually as standalone app.

As I mentioned it is not possible to override this property to allow to use NUnit Test runner installed to another directory. Can this issue be fixed by Ranorex Studio Developers?


See also Unit test for NUnitConsoleApplication

User avatar
Vega
Posts: 109
Joined: Mon Jul 11, 2016 2:15 pm

Re: Code coverage and debugging support for NUnit C# code

Post by Vega » Mon Apr 16, 2018 4:30 am

I think the below link will be helpful for your first post if you have not yet seen it:

http://community.sharpdevelop.net/blogs ... Cover.aspx

For your second post I'm afraid I'm not 100% clear on what you are having trouble with. Would it be possible to upload a small sample solution? If this is functionality that you believe Ranorex is missing, it may be worthwhile to submit a user voice post. I did not see any existing User Voice posts related to your question:

https://uservoice.ranorex.com/forums/15 ... ve-ranorex