|
Hi everyone:
I have the following lines of code in a project under test:
if (PropertyTree.Length > 1 && PropertyTree[1] != "P") { // Use the P as the start object o = risk; CurrentProperty = 1; }
When I turn on Code Coverage Coloring in the IDE, both lines inside the if-statement are blue, indicating that they were tested.
However, the if statement itself is beige, indicating that only part of that line was tested. Considering that this is an AND operation, I don't see how the if statement could have evaluated to "true" without testing both conditions? (unless the compiler somehow optimized away the second part because it already knew that PropertyTree[1] was not equal to "P", but how then can I turn that behavior off for unit tests?)
Is that a bug in the coloring logic, or am I missing something?
SA. |