View Javadoc
1   package org.csveed.bean.conversion;
2   
3   import static org.junit.jupiter.api.Assertions.assertEquals;
4   
5   import org.csveed.token.ParseState;
6   import org.junit.jupiter.api.Test;
7   
8   public class EnumConverterTest {
9   
10      @Test
11      public void convertToEnum() throws Exception {
12          EnumConverter<ParseState> converter = new EnumConverter<>(ParseState.class);
13          assertEquals(ParseState.SKIP_LINE, converter.fromString("SKIP_LINE"));
14      }
15  
16      @Test
17      public void convertFromEnum() throws Exception {
18          EnumConverter<ParseState> converter = new EnumConverter<>(ParseState.class);
19          assertEquals("SKIP_LINE", converter.toString(ParseState.SKIP_LINE));
20      }
21  
22  }