How can I create test cases using JUNIT to test ENUMS types. Below I added my code with the enum type.
public class TrafficProfileExtension { public static enum CosProfileType { BENIGN ("BENIGN"), CUSTOMER ("CUSTOMER"), FRAME ("FRAME"), PPCO ("PPCO"), STANDARD ("STANDARD"), W_RED ("W-RED"), LEGACY("LEGACY"), OPTIONB ("OPTIONB"); private final String cosProfileType; private CosProfileType(String s) { cosProfileType = s; } public boolean equalsName(String otherName){ return (otherName == null)? false:cosProfileType.equals(otherName); } public String toString(){ return cosProfileType; } } } I created a test case for my enum CosProfileType, and I am getting an error on CosProfileType.How can I make this test case work?
@Test public void testAdd() { TrafficProfileExtension ext = new TrafficProfileExtension(); assertEquals("FRAME", ext.CosProfileType.FRAME); }
Stringis equal to anenuminstance. What isext?