public void CalculateMinimumFuelConsumptionCorrectly_WhenConsumptionIsIncremental() { var sut = SubmarineAlignment.CreateWithIncrementalConsumption(SAMPLE_POSITIONS); Assert.Equal(168, sut.MinimumFuelConsumption); }
public void SolveSecondPuzzle() { var sut = SubmarineAlignment.CreateWithIncrementalConsumption(REAL_POSITIONS); Assert.Equal(98363777, sut.MinimumFuelConsumption); }
public void SolveFirstPuzzle() { var sut = SubmarineAlignment.CreateWithConstantConsumption(REAL_POSITIONS); Assert.Equal(347011, sut.MinimumFuelConsumption); }
public void CalculateMinimumFuelConsumptionCorrectly(string positions, int expectedValue) { var sut = SubmarineAlignment.CreateWithConstantConsumption(positions); Assert.Equal(expectedValue, sut.MinimumFuelConsumption); }
public void ReturnZero_WhenAllElementsInInputAreAligned(string positions) { var sut = SubmarineAlignment.CreateWithConstantConsumption(positions); Assert.Equal(0, sut.MinimumFuelConsumption); }
public void ReturnZero_WhenThereIsOnlyOneElementInInput(string position) { var sut = SubmarineAlignment.CreateWithConstantConsumption(position); Assert.Equal(0, sut.MinimumFuelConsumption); }
public void ThrowException_WhenInitializedWithInvalidData(string invalidInput) { var exception = Assert.Throws <ArgumentException>(() => SubmarineAlignment.CreateWithConstantConsumption(invalidInput)); Assert.Equal("Invalid input", exception.Message); }