1
2
3
4
5
6
7
8
9
10
11 package org.csveed.bean.conversion;
12
13 import static org.junit.jupiter.api.Assertions.assertEquals;
14
15 import org.csveed.token.ParseState;
16 import org.junit.jupiter.api.Test;
17
18
19
20
21 class EnumConverterTest {
22
23
24
25
26
27
28
29 @Test
30 void convertToEnum() throws Exception {
31 EnumConverter<ParseState> converter = new EnumConverter<>(ParseState.class);
32 assertEquals(ParseState.SKIP_LINE, converter.fromString("SKIP_LINE"));
33 }
34
35
36
37
38
39
40
41 @Test
42 void convertFromEnum() throws Exception {
43 EnumConverter<ParseState> converter = new EnumConverter<>(ParseState.class);
44 assertEquals("SKIP_LINE", converter.toString(ParseState.SKIP_LINE));
45 }
46
47 }