public int GetGoldenTarget(IMyList targetPoints) { if (targetPoints.Count < 2) { throw new ArgumentException("points.Count < 2", nameof(targetPoints)); } return((targetPoints.GetFirst() + targetPoints.ElementAt(targetPoints.Count - 1)) / 2); }
public void ElementAt_NValuesAppended_ReturnsValueAtPositionK(int[] values, int index, int expectedValue) { IMyList list = CreateSUT(); //Usually avoid adding loops foreach (var value in values) { list.Append(value); } Assert.Equal(expectedValue, list.ElementAt(index)); }