feat: solved day 15 part 1...this was were i made it too last year

This commit is contained in:
Stevan Freeborn
2024-12-16 18:59:43 -06:00
parent b1e4d5b114
commit 3b06f96259
4 changed files with 550 additions and 47 deletions
@@ -0,0 +1,30 @@
namespace WarehouseWoes.Tests;
public class PuzzleParserTests
{
private async Task<string> GetPuzzleInput()
{
return await File.ReadAllTextAsync(Path.Combine(AppContext.BaseDirectory, "INPUT.txt"));
}
[Test]
public async Task Parse_WhenCalled_ItShouldReturnMapAndDirections()
{
var input = await GetPuzzleInput();
var result = PuzzleParser.Parse(input);
await Assert.That(result.Map).IsTypeOf<WarehouseMap>();
await Assert.That(result.Directions).IsTypeOf<List<Direction>>();
}
[Test]
public async Task PartOneSolution_WhenGivenPuzzleInput_ItShouldReturnExpectedSolution()
{
var input = await GetPuzzleInput();
var (map, directions) = PuzzleParser.Parse(input);
var result = map.MoveRobot(directions).CalculateTotalBoxGpsCoordinates();
await Assert.That(result).IsEqualTo(1318523);
}
}