Пример #1
0
        internal long GetPart1Solution()
        {
            string input             = File.ReadAllText(@"Inputs\Day14Input.txt");
            ResourceConverterMap map = new ResourceConverterMap(input);

            FuelConverterCalculator calculator = new FuelConverterCalculator(input, map);

            return(calculator.CalculateRequiredOre());
        }
Пример #2
0
        public void ShouldCalculatePart1ExamplesCorrectly(string relativeFilePath, int expected)
        {
            // Arrange
            string input             = File.ReadAllText(relativeFilePath);
            ResourceConverterMap map = new ResourceConverterMap(input);

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

            // Assert
            Assert.Equal(expected, actual);
        }
Пример #3
0
        public void ShouldCalculatePart1SolutionCorrectly()
        {
            // Arrange
            string input             = File.ReadAllText(@"Inputs\Day14Input.txt");
            ResourceConverterMap map = new ResourceConverterMap(input);
            int expected             = 899155;

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

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