11package de .havox_design .aoc2015 .day01 ;
22
3+ import org .junit .jupiter .api .Assertions ;
34import org .junit .jupiter .api .Test ;
5+ import org .junit .jupiter .params .ParameterizedTest ;
6+ import org .junit .jupiter .params .provider .Arguments ;
7+ import org .junit .jupiter .params .provider .MethodSource ;
8+
9+ import java .util .stream .Stream ;
410
511class Day01Test {
612
@@ -9,4 +15,24 @@ class Day01Test {
915 void testMainClass () {
1016 MainClass .main (new String [0 ]);
1117 }
18+
19+ @ ParameterizedTest
20+ @ MethodSource ("getDataForTask1" )
21+ void testTask1 (String fileName , int expectedFloor ) {
22+ Assertions .assertEquals (expectedFloor , NotQuiteLisp .processTask1 (fileName ));
23+ }
24+
25+ private static Stream <Arguments > getDataForTask1 () {
26+ return Stream .of (
27+ Arguments .of ("task1sample1.txt" , 0 ),
28+ Arguments .of ("task1sample2.txt" , 0 ),
29+ Arguments .of ("task1sample3.txt" , 3 ),
30+ Arguments .of ("task1sample4.txt" , 3 ),
31+ Arguments .of ("task1sample5.txt" , 3 ),
32+ Arguments .of ("task1sample6.txt" , -1 ),
33+ Arguments .of ("task1sample7.txt" , -1 ),
34+ Arguments .of ("task1sample8.txt" , -3 ),
35+ Arguments .of ("task1sample9.txt" , -3 )
36+ );
37+ }
1238}
0 commit comments