Add 2026 Day04 solution and tests

This commit is contained in:
Sebastian Lindemeier committed 2026-12-04 07:44:22 +01:00
1 parent 20c08e9ce6
commit e643951d0e
2 files changed
+118

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
using AdvenOfCode.Contracts;
namespace AoC_2026.Tests;
public class Day04Test
{
private readonly IPuzzleSolver<long> _sut;
private static readonly string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
private readonly string TestInputPath = @$"{rootPath}/AoC-PuzzleInputs/2026/Test/day04.txt";
private readonly string ProdInputPath = @$"{rootPath}/AoC-PuzzleInputs/2026/Prod/day04.txt";
public Day04Test()
{
_sut = new Day04();
}
[Fact]
public void Part01_Test_equals_16()
{
var actual = _sut.SolvePart1(TestInputPath);
Assert.Equal(16, actual);
}
[Fact]
public void Part01_Prod_equals_7897()
{
var actual = _sut.SolvePart1(ProdInputPath);
Assert.Equal(7897, actual);
}
[Fact]
public void Part02_Test_equals_29()
{
var actual = _sut.SolvePart2(TestInputPath);
Assert.Equal(29, actual);
}
[Fact]
public void Part02_Prod_equals_1589()
{
var actual = _sut.SolvePart2(ProdInputPath);
Assert.Equal(1589, actual);
}
}