dotcover

DotCover is reporting a weird lack of coverage


Can any one tell me why dotCover would mark the 2 lines in show in the attached image as not covered?

Given that this is a small class it is pulling the coverage down very close to our failure percentage.

I know that there isn't too much to go on, but we do seem to have adequate cover, I just can't figure out why it dislikes these 2 lines.

FWIW, we are using dotCover 2017.1 and it's being called by TeamCity

dotCover output


Solution

  • The end braces will normally get "hit" when the code path goes through them. It seems that that is not happening.

    It looks like queueClient.CompleteAsync might always throw, in your tests. As that method never finishes normally, no test ever goes through the non-catch path. Then in the catch, it always throws again, so no test ever exits the method normally. The two end braces are therefore skipped.

    Add a test where queueClient.CompleteAsync does not throw. The code path will then include the non-throw path, and exit the method normally - the skipped lines will then be covered.