-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay5Test.php
66 lines (53 loc) · 1.04 KB
/
Day5Test.php
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
<?php
declare(strict_types=1);
namespace XonneX\AdventOfCode\Y2021\Solutions\Day5;
use PHPUnit\Framework\TestCase;
class Day5Test extends TestCase
{
public function testSolvePartOneExample(): void
{
$day5 = new Day5();
$day5->setDebugInput(<<<TXT
0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2
TXT
);
self::assertSame('5', $day5->solvePartOne());
}
public function testSolvePartOne(): void
{
$day5 = new Day5();
self::assertSame('3990', $day5->solvePartOne());
}
public function testSolvePartTwoExample(): void
{
$day5 = new Day5();
$day5->setDebugInput(<<<TXT
0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2
TXT
);
self::assertSame('12', $day5->solvePartTwo());
}
public function testSolvePartTwo(): void
{
$day5 = new Day5();
self::assertSame('21305', $day5->solvePartTwo());
}
}