feat: solve part 1 and part 2 of puzzle 6

This commit is contained in:
Stevan Freeborn
2023-12-06 20:21:11 -06:00
parent 443e7385fd
commit 6462fd8027
6 changed files with 201 additions and 12 deletions
+38
View File
@@ -0,0 +1,38 @@
namespace WaitForIt.Tests;
public class PuzzleParserTests
{
private readonly PuzzleParser _sut = new();
[Theory]
[MemberData(nameof(TestData.ValidInputData), MemberType = typeof(TestData))]
public void Parse_WhenGivenValidInput_ItShouldReturnAListOfRaces(string[] input, List<Race> expected)
{
var result = _sut.ParseRaces(input);
result.Should().BeEquivalentTo(expected);
}
public static class TestData
{
private static readonly string[] ValidInput =
[
"Time: 7 15 30",
"Distance: 9 40 200"
];
public static IEnumerable<object[]> ValidInputData =>
new List<object[]>
{
new object[]
{
ValidInput,
new List<Race>
{
new(7, 9),
new(15, 40),
new(30, 200)
}
}
};
}
}