public void RepeatingArray() { var testArray = new[] { 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, }; var result = SeekClosestToAverageClass.SeekClosestToAverage(testArray); Assert.AreEqual(2, result); }
public void SingleItemArray() { var testArray = new[] { 1 }; var result = SeekClosestToAverageClass.SeekClosestToAverage(testArray); Assert.AreEqual(1, result); }
public void GivenTestCase() { var testArray = new[] { 1, 2, 3, 5, -1, 7, 145, -33, 22, 14 }; var result = SeekClosestToAverageClass.SeekClosestToAverage(testArray); Assert.AreEqual(14, result); }
public void EmptyArray() { Assert.ThrowsException <Exception>(() => SeekClosestToAverageClass.SeekClosestToAverage(new int[0])); }