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)); }
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); }
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); }