Running NCover by using dll files

Running NCover by using dll files

Hi

I'm stucked with a problem: I understand how to run NCover by using NUnit dll's or by using executible files, but what if I have a project that produces .dll files, can I use them to run NCover? If not - How can I use NCover to test this project?

Hope my question was clear...

Thank's


RE: Running NCover by using dll files

Hi Pinhasa,

If I understand your question correctly, then the basic answer is that NCover has to load the DLLs in order to cover them.

It doesn't matter whether you run functional tests against the DLLs, test manually, or use automated scripts, but the code has to be executed to be covered.

Does this make sense?

Regards,

NCover Support


RE: Running NCover by using dll files

Hello again, Thank's for the response,

I'll try and elaborate because I think I don't quite understand:

I'm building a great amount of projects, most of my projects produce dll files (and not executable files), I also have test projects that produces dll's that are executed by NUnit.

Lets say I have a project that produces the file "a.dll" and I also have a test project that produces the file "test.dll", This test project has a reference to the file "a.dll" but does not contain tests that make calls to methodes from "a.dll", in other words - it knows a.dll but does not make any use of it.

Now I'm running NCover by running NUnit on "test.dll" - my question is: Do the methods in the file "a.dll" is taken into consideration in the NCover report? I expect that they will be displayed in the report (although with 0% coverage, but still displayed in the report), but when I try to do that - Methodes originated in "a.dll" are not mentioned in the report. Is this supposed to be like that or am I doing something wrong?

Hope I've made myself clear

Thank's


RE: Running NCover by using dll files

Hi pinhasa,

Thanks for elaborating - now I understand what you are asking.

NCover must load an assembly in order to profile it, so to get coverage on a.dll, the test.dll has to force any untested modules to be loaded.

A solution to this problem is to create a special test fixture. Another NCover user tried this approach recently and was happy with the results.

Here's an NCover Forum post that explains how the test fixture works in more detail:

http://www.ncover.com/forum/show_topic?id=1245

Please let us know what you think, or if you have any questions.

Best regards,

NCover Support