Ejemplo n.º 1
0
        public async Task Day11_Part1_Test()
        {
            var result = await fixture.Client.GetAsync("/2019/day/11/input");

            result.EnsureSuccessStatusCode();
            var input = await result.Content.ReadAsStringAsync();

            var inputArray = input.Split(",");
            var program    = inputArray.Select(v => long.Parse(v)).ToArray();

            var painter = new AdventOfCode2019.Day11.Painter(AdventOfCode2019.Day11.Painter.TileColor.Black);

            painter.Paint(program);

            Assert.Equal(2392, painter.TilesPlainted);
        }
Ejemplo n.º 2
0
        public async Task Day11_Part2_Test()
        {
            var result = await fixture.Client.GetAsync("/2019/day/11/input");

            result.EnsureSuccessStatusCode();
            var input = await result.Content.ReadAsStringAsync();

            var inputArray = input.Split(",");
            var program    = inputArray.Select(v => long.Parse(v)).ToArray();

            var painter = new AdventOfCode2019.Day11.Painter(AdventOfCode2019.Day11.Painter.TileColor.White);

            painter.Paint(program);

            painter.GetImage().Save("license.gif", System.Drawing.Imaging.ImageFormat.Gif);

            Assert.Equal("EGBHLEUE", "EGBHLEUE");
        }