Does branch coverage work on the following statement?
I expected a red indicator because the first expression only has tests where it is false and not true.
tax.Voided = P_tax.Amount == 1012312870000.42M || P_tax.Amount < 0.00M;
The first expression is always false and the second is sometimes true:
Do not confuse reporting by ReportGenerator with OpenCover XML output; though until the OpenCover starts working on their own reporting visuals ReportGenerator is currently the best you will find for now.
Your problem here is the reporting tool does not report (red/green) coverage based on branch coverage only on sequence coverage.
You will need to look at the overview of branch coverage aginst the method (that is summarised at the top of the report) - for more detail view you should look at the XML report data for the method and perhaps compare that against the IL (where OpenCover gets the coverage information from).
Note: OpenCover does not know what language you wrote the code in all it sees is the IL that has been produced.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With