1
2
3
4 package de.powerstat.validation.values.test;
5
6
7 import static org.junit.jupiter.api.Assertions.assertAll;
8 import static org.junit.jupiter.api.Assertions.assertEquals;
9
10 import org.junit.jupiter.api.Test;
11
12 import de.powerstat.validation.values.Weekday;
13
14
15
16
17
18 final class WeekdayTests
19 {
20
21
22
23 private static final String MONDAY_ACTION_NOT_AS_EXPECTED = "1 action not as expected";
24
25
26
27
28
29 WeekdayTests()
30 {
31 super();
32 }
33
34
35
36
37
38 @Test
39 void testFactory1()
40 {
41 assertEquals(1, Weekday.of("MONDAY").getAction(), MONDAY_ACTION_NOT_AS_EXPECTED);
42 }
43
44
45
46
47
48 @Test
49 void testGetAction()
50 {
51 assertAll("getAction",
52 () -> assertEquals(1, Weekday.MONDAY.getAction(), MONDAY_ACTION_NOT_AS_EXPECTED),
53 () -> assertEquals(2, Weekday.TUESDAY.getAction(), "2 action not as expected"),
54 () -> assertEquals(3, Weekday.WEDNESDAY.getAction(), "3 action not as expected"),
55 () -> assertEquals(4, Weekday.THURSDAY.getAction(), "4 action not as expected"),
56 () -> assertEquals(5, Weekday.FRIDAY.getAction(), "5 action not as expected"),
57 () -> assertEquals(6, Weekday.SATURDAY.getAction(), "6 action not as expected"),
58 () -> assertEquals(7, Weekday.SUNDAY.getAction(), "7 action not as expected")
59 );
60 }
61
62
63
64
65
66 @Test
67 void testStringValue()
68 {
69 final Weekday wd = Weekday.MONDAY;
70 assertEquals("MONDAY", wd.stringValue(), "stringValue not as expected");
71 }
72
73
74 }