@@ -24,8 +24,27 @@ void testPart1(String fileName, int expectedResultLength) {
2424
2525 private static Stream <Arguments > getDataForPart1 () {
2626 return Stream .of (
27- Arguments .of ("part1sample1.txt" , 82350 ),
28- Arguments .of ("part1sample2.txt" , 107312 )
27+ Arguments .of ("sample1.txt" , 82350 ),
28+ Arguments .of ("sample2.txt" , 107312 ),
29+ Arguments .of ("sample3.txt" , 139984 ),
30+ Arguments .of ("sample4.txt" , 182376 ),
31+ Arguments .of ("sample5.txt" , 237746 )
32+ );
33+ }
34+
35+ @ ParameterizedTest
36+ @ MethodSource ("getDataForPart2" )
37+ void testPart2 (String fileName , int expectedResultLength ) {
38+ Assertions .assertEquals (expectedResultLength , Elves .solvePart2 (fileName ));
39+ }
40+
41+ private static Stream <Arguments > getDataForPart2 () {
42+ return Stream .of (
43+ Arguments .of ("sample1.txt" , 1166642 ),
44+ Arguments .of ("sample2.txt" , 1520986 ),
45+ Arguments .of ("sample3.txt" , 1982710 ),
46+ Arguments .of ("sample4.txt" , 2584304 ),
47+ Arguments .of ("sample5.txt" , 3369156 )
2948 );
3049 }
3150
@@ -38,21 +57,21 @@ void testProcessData(String fileName, String expectedString, int iterations) {
3857
3958 private static Stream <Arguments > getDataForProcessData () {
4059 return Stream .of (
41- Arguments .of ("part1sample1 .txt" , "11" , 1 ),
42- Arguments .of ("part1sample1 .txt" , "21" , 2 ),
43- Arguments .of ("part1sample1 .txt" , "1211" , 3 ),
44- Arguments .of ("part1sample1 .txt" , "111221" , 4 ),
45- Arguments .of ("part1sample1 .txt" , "312211" , 5 ),
46- Arguments .of ("part1sample2 .txt" , "21" , 1 ),
47- Arguments .of ("part1sample2 .txt" , "1211" , 2 ),
48- Arguments .of ("part1sample2 .txt" , "111221" , 3 ),
49- Arguments .of ("part1sample2 .txt" , "312211" , 4 ),
50- Arguments .of ("part1sample3 .txt" , "1211" , 1 ),
51- Arguments .of ("part1sample3 .txt" , "111221" , 2 ),
52- Arguments .of ("part1sample3 .txt" , "312211" , 3 ),
53- Arguments .of ("part1sample4 .txt" , "111221" , 1 ),
54- Arguments .of ("part1sample4 .txt" , "312211" , 2 ),
55- Arguments .of ("part1sample5 .txt" , "312211" , 1 )
60+ Arguments .of ("sample1 .txt" , "11" , 1 ),
61+ Arguments .of ("sample1 .txt" , "21" , 2 ),
62+ Arguments .of ("sample1 .txt" , "1211" , 3 ),
63+ Arguments .of ("sample1 .txt" , "111221" , 4 ),
64+ Arguments .of ("sample1 .txt" , "312211" , 5 ),
65+ Arguments .of ("sample2 .txt" , "21" , 1 ),
66+ Arguments .of ("sample2 .txt" , "1211" , 2 ),
67+ Arguments .of ("sample2 .txt" , "111221" , 3 ),
68+ Arguments .of ("sample2 .txt" , "312211" , 4 ),
69+ Arguments .of ("sample3 .txt" , "1211" , 1 ),
70+ Arguments .of ("sample3 .txt" , "111221" , 2 ),
71+ Arguments .of ("sample3 .txt" , "312211" , 3 ),
72+ Arguments .of ("sample4 .txt" , "111221" , 1 ),
73+ Arguments .of ("sample4 .txt" , "312211" , 2 ),
74+ Arguments .of ("sample5 .txt" , "312211" , 1 )
5675 );
5776 }
5877}
0 commit comments