Should I test every condition in unit test when the conditional is based on a method of an enum?
I mean if I have an enum with a lot of values, the unit test gets too big to reach all possible conditions.
Example:
public enum AnEnum {
A(true), B(false), C(false), D(true);
AnEnum(boolean isError) {
this.isError = isError
}
}
public class TestEnum {
public String method(AnEnum anEnum) {
if( anEnum.isError() ) {
return "An Error";
}
return "Not An Error";
}
}