Ejemplo n.º 1
0
    public void Y2021_Day20_Enhance_Returns_Correct_Value(int enhancements, int expected)
    {
        // Arrange
        string[] algorithm =
        {
            "..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..##",
            "#..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###",
            ".######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#.",
            ".#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#.....",
            ".#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#..",
            "...####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.....",
            "..##..####..#...#.#.#...##..#.#..###..#####........#..####......#..#",
        };

        string[] imageData =
        {
            string.Join(string.Empty, algorithm),
            string.Empty,
            "#..#.",
            "#....",
            "##..#",
            "..#..",
            "..###",
        };

        // Act
        (int actual, _) = Day20.Enhance(imageData, enhancements, Logger);

        // Assert
        actual.ShouldBe(expected);
    }