Ejemplo n.º 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());
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }