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 NCrunch Developer
#3204
19 Nov 2012 19:58 UTC
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'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
Remco 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 NCrunch Developer
#3216
19 Nov 2012 21:32 UTC
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.
Remco 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.
Post a reply
Log in to reply.