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_WhenThereIsOnlyOneElementInInput(string position) { var sut = SubmarineAlignment.CreateWithConstantConsumption(position); Assert.Equal(0, sut.MinimumFuelConsumption); }
public void ReturnZero_WhenAllElementsInInputAreAligned(string positions) { var sut = SubmarineAlignment.CreateWithConstantConsumption(positions); 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); }