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

Notification

Icon
Error

Brace on new line && code coverage.
Micah71381
#1 Posted : Friday, November 8, 2013 2:48:53 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/18/2013(UTC)
Posts: 27
Location: United States of America

Was thanked: 2 time(s) in 2 post(s)
If you create a test method and put the open curly brace on the same line as the method definition, the code coverage '>' indicator in the left margin will show up on the line with the method name (and curly brace). If you put the curly brace on the following line then the '>' shows up on the following line and there are no code coverage indicators on the line with the method name.

This problem is greatly amplified when you utilize code outlining to collapse methods down to definitions. Methods that have the curly brace on a new line have no code coverage indicators visible when collapsed so you must uncollapse each method to see if it is green or red.

The same problem occurs for normal code coverage indicators throughout the solution, making it so you cannot glance at an outline-collapsed class and get an idea of which methods have coverage and which do not.
Remco
#2 Posted : Friday, November 8, 2013 2:57:07 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,986

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

This is caused by limitations in how the .NET compilers work and the data that is available to NCrunch. Because NCrunch is language agnostic, it relies on information from the .PDB files created by the compiler. While these PDB files contain information about the location of every line of executable code, they do not contain information about method and type signatures. This means NCrunch has no way of knowing where a method is actually declared, it simply marks out coverage on the contents of the method.

There are new developments that may help with innovation in this area (such as Roslyn), but for the time being, I'm afraid there isn't much that can be feasibly done to change the way this works.


Cheers,

Remco
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.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download