feat: solved day 2 part 1...part 2 is WIP

This commit is contained in:
Stevan Freeborn
2024-12-03 02:32:30 -06:00
parent 17f6c01170
commit 60b5c726cf
10 changed files with 340 additions and 1 deletions
@@ -0,0 +1,31 @@
namespace RedNosedReports.Tests;
public class PuzzleParserTests
{
private readonly PuzzleParser _puzzleParser = new();
[Test]
public async Task Parse_WhenGivenInput_ItShouldReturnListOfReports()
{
string[] input = [
"7 6 4 2 1",
"1 2 7 8 9",
"9 7 6 2 1",
"1 3 2 4 5",
"8 6 4 4 1",
"1 3 6 7 9",
];
var result = _puzzleParser.Parse(input);
await Assert.That(result).IsEquivalentTo(new List<Report>()
{
new([7, 6, 4, 2, 1]),
new([1, 2, 7, 8, 9]),
new([9, 7, 6, 2, 1]),
new([1, 3, 2, 4, 5]),
new([8, 6, 4, 4, 1]),
new([1, 3, 6, 7, 9]),
});
}
}