public void SamplePart1(string[] wires, string expectedDistance) { var solver = new Day03Solver(); var distance = solver.SolvePart1(wires); Assert.Equal(expectedDistance, distance); }
public void TestPart2Solution(string inputFile, UInt64 expected) { // Arrange string[] lines = System.IO.File.ReadAllLines($"../../../{inputFile}"); // Act var result = Day03Solver.Part2Solution(lines); // Assert Assert.Equal(expected, result); }
public void TestResolver() { var input = @"..##....... #...#...#.. .#....#..#. ..#.#...#.# .#...##..#. ..#.##..... .#.#.#....# .#........# #.##...#... #...##....# .#..#...#.#"; var lines = input.Split('\n'); var result = new Day03Solver(lines).GetNumTrees(3, 1); Assert.Equal(7, result); }
public void TestSolvePartB() { Solver s = new Day03Solver(); IEnumerable <string> input = new List <string> { "..##.......", "#...#...#..", ".#....#..#.", "..#.#...#.#", ".#...##..#.", "..#.##.....", ".#.#.#....#", ".#........#", "#.##...#...", "#...##....#", ".#..#...#.#", }; Assert.AreEqual("336", s.SolvePartB(input)); }