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

Notification

Icon
Error

Xunit Theory and Code Coverage Markers
pglaspey
#1 Posted : Monday, November 19, 2012 4:30:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 6/1/2012(UTC)
Posts: 28
Location: California

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I have issues when using Theory tests with xunit where code that gets hit by test does not always get marked as covered. It is intermittent. If I break out the tests into facts then it always shows as covered.

Any ideas?
Remco
#2 Posted : Monday, November 19, 2012 7:58:40 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 961 times
Was thanked: 1291 time(s) in 1197 post(s)
Hi, thanks for posting!

I'm wondering if this may be to related to the execution pattern taken by the tests while NCrunch is recording coverage. There's a good description in the documentation of how NCrunch's code coverage analysis method can sometimes show unexpected results depending upon the situation. This may be worth having a read to see if it clarifies anything. If you're able to post any code here, or perhaps a screenshot, I'll be happy to delve into the detail with you and we'll see if we can figure it out.


Cheers,

Remco
pglaspey
#3 Posted : Monday, November 19, 2012 9:23:32 PM(UTC)
Rank: Member

Groups: Registered
Joined: 6/1/2012(UTC)
Posts: 28
Location: California

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Remco;3204 wrote:
Hi, thanks for posting!

I'm wondering if this may be to related to the execution pattern taken by the tests while NCrunch is recording coverage. There's a good description in the documentation of how NCrunch's code coverage analysis method can sometimes show unexpected results depending upon the situation. This may be worth having a read to see if it clarifies anything. If you're able to post any code here, or perhaps a screenshot, I'll be happy to delve into the detail with you and we'll see if we can figure it out.


Cheers,

Remco



I am guessing this situation falls under Dynamic Test Cases
Remco
#4 Posted : Monday, November 19, 2012 9:32:26 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 961 times
Was thanked: 1291 time(s) in 1197 post(s)
For an Xunit theory, this is quite possible. Also have a read of the difference between Logical and Physical code coverage, as depending upon the nature of your code, this may also have an impact on your code coverage.
pglaspey
#5 Posted : Monday, November 19, 2012 9:33:58 PM(UTC)
Rank: Member

Groups: Registered
Joined: 6/1/2012(UTC)
Posts: 28
Location: California

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Remco;3216 wrote:
For an Xunit theory, this is quite possible. Also have a read of the difference between Logical and Physical code coverage, as depending upon the nature of your code, this may also have an impact on your code coverage.



Well I worked around it. I had to break out some of the tests from Theory to Fact to get coverage showing 100%.

Would rather not have to do that but I was able to do it and add some additional coverage, so it worked out well.
1 user thanked pglaspey for this useful post.
Remco on 11/19/2012(UTC)
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.038 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download