Is it possible to configure dotCover to highlight partially covered statements in a specific colour?
Answered
Hello.
I am using dotCover 2021.1.20210722.102121
When using the "Cover Unit Tests" option, and viewing the highlighted code in the Visual Studio 2019 IDE, I notice that dotCover behaves slightly different to Visual Studio's own Code Coverage tool.
Take this code example...
public int CalcNumber(int num1, int num2)
{
return num1 > 2 ? num2 : ++num1;
}
When running the unit tests, dotCover will highlight the above "return" line in green. The Visual Studio Code Coverage tool will highlight it in a light orange colour, to indicate that it is partially covered, which is what I expected, as I wrote a unit test to cater for just the first part of the ternary statement.
Does dotCover support the ability to colour partially covered statements?
Thanks.
Please sign in to leave a comment.
Any news about this?
dotCover performs partially background highlighting of covered lines based on statements, for example
But the ternary conditional, null-coalescing and some other operators are counted as one statement in the runtime.
It is a known issue DCVR-11537 “Null check operator '??' counts as one statement”. Please upvote it or leave a comment to subscribe to the issue and receive updates.