Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Code coverage missing when using plain reference to project DLL
ArneG
#1 Posted : Monday, May 30, 2016 7:33:12 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/26/2014(UTC)
Posts: 3
Location: Denmark

Given a solution with two projects, P and P.Test, if the project file for P.Test includes a project reference to P, coverage markers in P code turn green when a test in P.Test causes that code to execute. Fine.

If I replace the project reference with a plain reference to the DLL built by the P project, the coverage markers turn black, which is no surprise.

However, I would have expected them to turn green again when I add P to the 'Implicit project dependencies' in the NCrunch Configuration of P.Test, but this does not seem to be the case.

What am I missing here?
Remco
#2 Posted : Monday, May 30, 2016 10:48:42 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting.

The 'Implicit project dependencies' setting exists for a different purpose. This setting is intended to help you find the location of assemblies in the NCrunch workspace using your own code at runtime - it won't change NCrunch's assembly resolution logic.

The setting you are looking for is 'Infer project references using assembly name' - http://www.ncrunch.net/documentation/reference_solution-configuration_infer-project-references-using-assembly.
ArneG
#3 Posted : Monday, May 30, 2016 11:01:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/26/2014(UTC)
Posts: 3
Location: Denmark

Remco;8786 wrote:
Hi, thanks for posting.

The 'Implicit project dependencies' setting exists for a different purpose. This setting is intended to help you find the location of assemblies in the NCrunch workspace using your own code at runtime - it won't change NCrunch's assembly resolution logic.

The setting you are looking for is 'Infer project references using assembly name' - http://www.ncrunch.net/documentation/reference_solution-configuration_infer-project-references-using-assembly.


Ah, I see—thanks!

Consider this scenario:

Project P builds into assembly X.dll (i.e., "X" is different from "P")
Project P.Test has a file reference to X.dll

Infer project references using assembly name is set to True.

It seems that the coverage dots in P code in this case still stay black in this scenario; am I correct?
Remco
#4 Posted : Monday, May 30, 2016 12:20:40 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
ArneG;8787 wrote:

It seems that the coverage dots in P code in this case still stay black in this scenario; am I correct?


Yes, you are correct. For this setting to behave the way you need it to, the assembly name must match the project name.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download