Hi,
I can't have 100% coverage when I use enums.
Ex.:
public enum MyEnum { A,B; }
Test:
if(myenum.equals(MyEnum.A) { } else if(myenum.equals(MyEnum.B) { }
this last "else if" always give 1 missed false branch.
You can use a switch statement. For instance:
switch (en) { case A: break; case B: break; }
will show 100% coverage if called with en==MyEnum.A and en==MyEnum.B.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.