11package com .adventofcode .flashk .day17 ;
22
3+ import com .adventofcode .flashk .common .Vector2 ;
4+ import org .apache .commons .lang3 .tuple .ImmutablePair ;
35import org .junit .jupiter .api .BeforeAll ;
46import org .junit .jupiter .api .Disabled ;
57import org .junit .jupiter .api .DisplayName ;
1820import com .adventofcode .flashk .common .test .utils .Input ;
1921
2022import static org .junit .jupiter .api .Assertions .assertEquals ;
23+ import static org .junit .jupiter .api .Assertions .assertFalse ;
24+ import static org .junit .jupiter .api .Assertions .assertTrue ;
2125
2226@ DisplayName (TestDisplayName .DAY_17 )
2327@ TestMethodOrder (OrderAnnotation .class )
24- @ Disabled
2528public class Day17Test extends PuzzleTest {
2629
2730 private final static String INPUT_FOLDER = TestFolder .DAY_17 ;
@@ -31,7 +34,24 @@ public static void beforeAll() {
3134 Timer .printHeader (TestDisplayName .DAY_17 );
3235 }
3336
34-
37+ @ Test
38+ void testSets () {
39+ Tile tile = new Tile (2 ,2 ,2 );
40+ tile .visit (ImmutablePair .of (Vector2 .left (), 1 ));
41+ tile .visit (ImmutablePair .of (Vector2 .left (), 2 ));
42+ tile .visit (ImmutablePair .of (Vector2 .left (), 3 ));
43+ tile .visit (ImmutablePair .of (Vector2 .right (), 1 ));
44+ tile .visit (ImmutablePair .of (Vector2 .right (), 2 ));
45+ tile .visit (ImmutablePair .of (Vector2 .right (), 3 ));
46+
47+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .left (),1 )));
48+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .left (),2 )));
49+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .left (),3 )));
50+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .right (),1 )));
51+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .right (),2 )));
52+ assertTrue (tile .isVisited (ImmutablePair .of (Vector2 .right (),3 )));
53+ assertFalse (tile .isVisited (ImmutablePair .of (Vector2 .right (),4 )));
54+ }
3555 @ Test
3656 @ Order (1 )
3757 @ Tag (TestTag .PART_ONE )
@@ -50,6 +70,25 @@ public void testSolvePart1Sample() {
5070 assertEquals (102 , result );
5171
5272 }
73+
74+ @ Test
75+ @ Order (1 )
76+ @ Tag (TestTag .PART_ONE )
77+ @ Tag (TestTag .SAMPLE )
78+ @ DisplayName (TestDisplayName .PART_ONE_SAMPLE )
79+ public void testSolvePart1SingleSample () {
80+
81+ System .out .print ("1 | sample | " );
82+
83+ // Read input file
84+ int [][] inputs = Input .read2DIntArray (INPUT_FOLDER , TestFilename .INPUT_FILE_SINGLE_SAMPLE );
85+
86+ ClumsyCrucibleRefactor clumsyCrucible = new ClumsyCrucibleRefactor (inputs );
87+ long result = clumsyCrucible .solveA ();
88+
89+ assertEquals (7 , result );
90+
91+ }
5392
5493 @ Test
5594 @ Order (2 )
0 commit comments