-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDayXXTest.java
76 lines (59 loc) · 1.99 KB
/
DayXXTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package aminetti.adventofcode2024.dayXX;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
import java.io.IOException;
import java.util.List;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.commons.io.IOUtils.readLines;
import static org.apache.commons.io.IOUtils.resourceToString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
class DayXXTest {
@Test @EnabledIf("inputExists")
void actualInputPart1() throws IOException {
// given
List<String> input = readLines(resourceToString("/dayXX/dayXX_input.txt", UTF_8));
// when
DayXX solver = new DayXX();
solver.parseInput(input);
long l = solver.solvePart1();
// then
assertThat(l, is(0L));
}
@Test
void testInputPart1() throws IOException {
// given
List<String> input = readLines(resourceToString("/dayXX/dayXX_input_test.txt", UTF_8));
// when
DayXX solver = new DayXX();
solver.parseInput(input);
long l = solver.solvePart1();
// then
assertThat(l, is(0L));
}
@Test @EnabledIf("inputExists")
void actualInputPart2() throws IOException {
// given
List<String> input = readLines(resourceToString("/dayXX/dayXX_input.txt", UTF_8));
// when
DayXX solver = new DayXX();
solver.parseInput(input);
long l = solver.solvePart2();
// then
assertThat(l, is(0L));
}
@Test
void testInputPart2() throws IOException {
// given
List<String> input = readLines(resourceToString("/dayXX/dayXX_input_test.txt", UTF_8));
// when
DayXX solver = new DayXX();
solver.parseInput(input);
long l = solver.solvePart2();
// then
assertThat(l, is(0L));
}
public static boolean inputExists() {
return DayXXTest.class.getResource("/dayXX/dayXX_input.txt") != null;
}
}