This is probably a rather simple question, but I'm at a loss...
I have an if statement like the following:
if(TheEnum.A.equals(myEnum) || TheEnum.B.equals(myEnum))
TheEnum
can be A
, B
, C
, ... G
(more than just 4 options).
JaCoCo (SONAR) tells me that there are four conditions I can cover here. Which ones are those? Isn't the entire set I can test for in this instance essentially
if(true || not_evaluated) => true
if(false || true) => true
if(false || false) => false
I'm pretty sure I can't specifically test for
if(true || true)
or
if(true || false)
,
as short circuit evaluation won't get that far...?
If so, what is the forth option JaCoCo/Sonar wants me to test for?
|
to see what JaCoCo says to that. – Promptbookcannot
exist. If myEnum is A, it isnot
B. I can only see three cases in the given snippet of code.myEnum
must be one of (A, B, not-A-or-B). That's three cases. – Multimillionaire