示例#1
0
        internal long GetPart2Solution()
        {
            string input             = File.ReadAllText(@"Inputs\Day14Input.txt");
            ResourceConverterMap map = new ResourceConverterMap(input);
            long oreCount            = 1_000_000_000_000;

            FuelConverterCalculator calculator = new FuelConverterCalculator(input, map);

            return(calculator.CalculateFuelProduced(oreCount));
        }
示例#2
0
        public void ShouldCalculatePart2ExamplesCorrectly(string relativeFilePath, int expected)
        {
            // Arrange
            string input             = File.ReadAllText(relativeFilePath);
            ResourceConverterMap map = new ResourceConverterMap(input);
            long oreCount            = 1_000_000_000_000;

            // Act
            FuelConverterCalculator calculator = new FuelConverterCalculator(input, map);
            long actual = calculator.CalculateFuelProduced(oreCount);

            // Assert
            Assert.Equal(expected, actual);
        }
示例#3
0
        public void ShouldCalculatePart2SolutionCorrectly()
        {
            // Arrange
            string input             = File.ReadAllText(@"Inputs\Day14Input.txt");
            ResourceConverterMap map = new ResourceConverterMap(input);
            long oreCount            = 1_000_000_000_000;
            long expected            = 2390226;

            // Act
            FuelConverterCalculator calculator = new FuelConverterCalculator(input, map);
            long actual = calculator.CalculateFuelProduced(oreCount);

            // Assert
            Assert.Equal(expected, actual);
        }