Exemple #1
0
        public async Task Day06_Part1_Test()
        {
            //var input = "COM)B\nB)C\nC)D\nD)E\nE)F\nB)G\nG)H\nD)I\nE)J\nJ)K\nK)L";
            var result = await fixture.Client.GetAsync("/2019/day/6/input");

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

            var checkSum = Day06.CalculateOrbitCountCheckSum(input, out _);

            Assert.Equal(142915, checkSum);
        }
Exemple #2
0
        public async Task Day06_Part2_Test()
        {
            //var input = "COM)B\nB)C\nC)D\nD)E\nE)F\nB)G\nG)H\nD)I\nE)J\nJ)K\nK)L";
            var result = await fixture.Client.GetAsync("/2019/day/6/input");

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

            var checkSum       = Day06.CalculateOrbitCountCheckSum(input, out var orbits);
            var orbitTransfers = Day06_Part2.OrbitalTransfers(orbits, "YOU", "SAN");

            Assert.Equal(283, orbitTransfers);
        }