示例#1
0
        public void GivenAnEmptyArray_Reverse_ReturnsAnEmptyArray()
        {
            int[] array  = { };
            var   result = CollectionsExercisesClass.Reverse(array);

            Assert.AreEqual(0, array.Length);
        }
示例#2
0
        public void GivenAnArray_Reverse_ReturnsTheArrayInReverse()
        {
            int[] array  = { 10, 20, 30, 40, 50 };
            var   result = CollectionsExercisesClass.Reverse(array);

            Assert.AreEqual(5, array.Length);
            for (int i = 0; i < 5; i++)
            {
                Assert.AreEqual(array[4 - i], result[i]);
            }
        }