Exemplo n.º 1
0
        public async Task Day10_Part1_Test()
        {
            var asteroidMap = ".#..#\n.....\n#####\n....#\n...##";

            asteroidMap = @"......#.#.
#..#.#....
..#######.
.#.#.###..
.#..#.....
..#....#.#
#..#....#.
.##.#..###
##...#..#.
.#....####";
            asteroidMap = @"#.#...#.#.
.###....#.
.#....#...
##.#.#.#.#
....#.#.#.
.##..###.#
..#...##..
..##....##
......#...
.####.###.";
            asteroidMap = @".#..##.###...#######
##.############..##.
.#.######.########.#
.###.#######.####.#.
#####.##.#.##.###.##
..#####..#.#########
####################
#.####....###.#.#.##
##.#################
#####.##.###..####..
..######..##.#######
####.##.####...##..#
.#####..#.######.###
##...#.##########...
#.##########.#######
.####.#.###.###.#.##
....##.##.###..#####
.#.#.###########.###
#.#.#.#####.####.###
###.##.####.##.#..##";

            // Here is the real input. Those before are examples from the puzzle.
            var result = await fixture.Client.GetAsync("/2019/day/10/input");

            result.EnsureSuccessStatusCode();
            asteroidMap = await result.Content.ReadAsStringAsync();

            var mapArray           = asteroidMap.Split("\n").SkipLast(1).ToArray();
            var maxAsteroidsInView = Day10.CalculateMaxAsteroidsInView(mapArray);

            Assert.Equal(269, maxAsteroidsInView);
        }