public void GivenAnEmptyArray_Reverse_ReturnsAnEmptyArray() { int[] array = { }; var result = CollectionsExercise.Reverse(array); Assert.AreEqual(0, array.Length); }
public void GivenAnArray_Reverse_ReturnsTheArrayInReverse() { int[] array = { 10, 20, 30, 40, 50 }; var result = CollectionsExercise.Reverse(array); Assert.AreEqual(5, array.Length); for (int i = 0; i < 5; i++) { Assert.AreEqual(array[4 - i], result[i]); } }