A simple comparison is marked as not completely covered, although both branches of the if statement have been covered!?! How is that possible?
This is a small function I’ve created, which is also covered by unit tests. The light blue shade of the return statements indicate that they have been executed. So both branches of the if statement have been covered. But the light pink shade of the comparison indicates that the comparison has not been completely covered.
Having a logical expression marked as not completely covered is common if it includes any && or || operators that are short circuited. But there are no such operators here. So what is the reason for the partial coverage?
Jon Skeet on 2014-12-02
Is MyNumericType a class or a struct? Does it overload “<" and if so, what's the return type?
(Thoughts: if it's a reference type, what if value or SingleDigitLimit is null? If the return type of < is Nullable, have you covered all three possible options?)
Anders Abel on 2014-12-04
MyNumericType is a struct. To be more specific it is a system struct, with a generic argument that is also a struct. That inner struct overloads the < operator.