Daily Usage Issues

No coverage reporting on Property get - .Net, old-style property

Started by DamonOverboe on 8,768 views

I am covering a property with tests; it is a non-automatic property in VS 2012 c#, and it is indicating no coverage on the property. However, the set shows that it is covered.

I have put a breakpoint in the get and debugged the test to see that I am in fact hitting it.


I'm currently executing 2 of the three branches in the get, but no luck showing it. It's not a show-stopper, just odd.

I saw a forum post discussing auto-properties (that I can't find now) that was discussing this, and it sounds like it's not currently implemented?

Any plans to implement this in the near future? Again it's not that high priority of a request.
Hi Damon -

This sounds like a bug. Get/Set properties should definitely be tracked by NCrunch. This could be a mapping problem of some kind. Try doing a reset of the NCrunch engine and see if the resulting test run fixes the issue. Also - have a look at the documentation for an explanation of other things that can cause code coverage oddities - http://www.ncrunch.net/documentation/troubleshooting_missing-code-coverage.

Cheers,

Remco
I would bet it's related to the Lost Project References. We had to correct quite a few of those and still have 3-4 outstanding warnings, I'll dig into that tomorrow. *I don't think the remaining warnings are Lost Refs, but not positive.*

I did notice once that I got lucky and cleared something and was able to have it mark a getter as covered, towards the end of the day. I'll keep an eye on that, but I'll try to get those other warnings resolved first.
Lost project references can definitely cause this to happen. Even if you have no intention of continuing with NCrunch long term, I definitely would still recommend working through the warnings and addressing the ones that you are able to. Most of the warnings are caused by structural abnormalities with your solution that may not be surfacing problems with your current workflow, but could create some very confusing situations in future. Ultimately you are building a cleaner and more reliable solution :)
Yeah we're working through correcting those. This is for a company I am consulting with.

As you already know, I'm addicted to NCrunch, so I'll be continuing with it long term, just waiting for them to pay their 1st invoice before buying it, or my 30 day trial to run out, whichever comes first. :-D

Post a reply

Log in to reply.