Refactor Day08 to update data types, optimize method parameters, and improve test logic

This commit is contained in:
Sebastian Lindemeier
2025-12-08 16:55:19 +01:00
parent 9d8a611f76
commit 1b1c64b103
2 changed files with 35 additions and 23 deletions
+6 -4
View File
@@ -4,19 +4,19 @@ namespace AoC_2025.Tests;
public class Day08Test
{
private readonly Day08 _sut;
private IPuzzleSolver<long> _sut;
private static readonly string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
private readonly string TestInputPath = @$"{rootPath}\AoC-PuzzleInputs\2025\Test\day08.txt";
private readonly string ProdInputPath = @$"{rootPath}\AoC-PuzzleInputs\2025\Prod\day08.txt";
public Day08Test()
{
_sut = new Day08();
_sut = new Day08(10);
}
[Fact]
public void Part01_Test_equals_40()
{
var actual = _sut.SolvePart1(TestInputPath, 10);
var actual = _sut.SolvePart1(TestInputPath);
Assert.Equal(40, actual);
}
@@ -24,7 +24,9 @@ public class Day08Test
[Fact]
public void Part01_Prod_equals_42840()
{
var actual = _sut.SolvePart1(ProdInputPath, 1000);
_sut = new Day08(1000);
var actual = _sut.SolvePart1(ProdInputPath);
Assert.Equal(42840, actual);
}