1
+ package aminetti .adventofcode2024 .day03 ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+
5
+ import java .io .IOException ;
6
+ import java .util .List ;
7
+
8
+ import static java .nio .charset .StandardCharsets .UTF_8 ;
9
+ import static org .apache .commons .io .IOUtils .readLines ;
10
+ import static org .apache .commons .io .IOUtils .resourceToString ;
11
+ import static org .hamcrest .MatcherAssert .assertThat ;
12
+ import static org .hamcrest .Matchers .is ;
13
+
14
+ class Day03Test {
15
+
16
+ @ Test
17
+ void actualInputPart1 () throws IOException {
18
+ // given
19
+ List <String > input = readLines (resourceToString ("/day03/day03_input.txt" , UTF_8 ));
20
+
21
+ // when
22
+ Day03 solver = new Day03 ();
23
+ solver .parseInput (input );
24
+ long l = solver .solvePart1 ();
25
+
26
+ // then
27
+ assertThat (l , is (179834255L ));
28
+ }
29
+
30
+ @ Test
31
+ void testInputPart1 () throws IOException {
32
+ // given
33
+ List <String > input = readLines (resourceToString ("/day03/day03_input_test.txt" , UTF_8 ));
34
+
35
+ // when
36
+ Day03 solver = new Day03 ();
37
+ solver .parseInput (input );
38
+ long l = solver .solvePart1 ();
39
+
40
+ // then
41
+ assertThat (l , is (161L ));
42
+ }
43
+
44
+ @ Test
45
+ void actualInputPart2 () throws IOException {
46
+ // given
47
+ List <String > input = readLines (resourceToString ("/day03/day03_input.txt" , UTF_8 ));
48
+
49
+ // when
50
+ Day03 solver = new Day03 ();
51
+ solver .parseInput (input );
52
+ long l = solver .solvePart2 ();
53
+
54
+ // then
55
+ assertThat (l , is (0L ));
56
+ }
57
+
58
+ @ Test
59
+ void testInputPart2 () throws IOException {
60
+ // given
61
+ List <String > input = readLines (resourceToString ("/day03/day03_input_test.txt" , UTF_8 ));
62
+
63
+ // when
64
+ Day03 solver = new Day03 ();
65
+ solver .parseInput (input );
66
+ long l = solver .solvePart2 ();
67
+
68
+ // then
69
+ assertThat (l , is (0L ));
70
+ }
71
+
72
+
73
+ }
0 commit comments