I have several classes that are implementing interfaces where the properties in the interface and in the concrete class are automatic properties. There don't seem to be any code coverage for these properties.
These properties are in fact covered and they seem to be contributing to the Code Coverage %, in some projects, but none of them have the green dot I am addicted to seeing and I have a few classes that have no coverage percentage due to this.
I have uninstalled NCrunch, rebooted, and re-installed to no effect.
Bob
Daily Usage Issues
Coverage information for Automatic Properties
Started by CourtJesterBob on 6,681 views
Remco NCrunch Developer
#3854
19 Mar 2013 21:41 UTC
Hi Bob,
Thanks for posting!
Auto-properties do not have debugging information generated for them by the compiler (i.e., you'll notice that you can't set breakpoints on them). Because of this, it's impossible for NCrunch to instrument them to retrieve code coverage information.
NCrunch will only calculate the code coverage percentage based on the 'compiled lines' as shown in the Metrics View column, which includes only the lines of code that have a coverage marker next to them. Can you think of any other reason why your files may not be showing code coverage? Are they perhaps consisting of files without markers? (i.e. simply data containers).
Cheers,
Remco
Thanks for posting!
Auto-properties do not have debugging information generated for them by the compiler (i.e., you'll notice that you can't set breakpoints on them). Because of this, it's impossible for NCrunch to instrument them to retrieve code coverage information.
NCrunch will only calculate the code coverage percentage based on the 'compiled lines' as shown in the Metrics View column, which includes only the lines of code that have a coverage marker next to them. Can you think of any other reason why your files may not be showing code coverage? Are they perhaps consisting of files without markers? (i.e. simply data containers).
Cheers,
Remco
Thanks for the response. That makes complete sense. I was getting worried about them because I have some project with large numbers of automatic properties and very low coverage.
But, if those lines are not included in the stats, that means that if there are only two lines of "compiled code" and I am only covering one of them, then I am at 50%. I had just assumed it was all of the automatic properties.
Bob
But, if those lines are not included in the stats, that means that if there are only two lines of "compiled code" and I am only covering one of them, then I am at 50%. I had just assumed it was all of the automatic properties.
Bob
Post a reply
Log in to reply.