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

Notification

Icon
Error

Coverage information for Automatic Properties
CourtJesterBob
#1 Posted : Tuesday, March 19, 2013 5:18:16 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 13
Location: Beachwood, OH

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
Remco
#2 Posted : Tuesday, March 19, 2013 9:41:18 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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
CourtJesterBob
#3 Posted : Tuesday, March 26, 2013 2:13:19 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 13
Location: Beachwood, OH

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