示例#1
0
        public void RotateSmallArrayTest()
        {
            int[] nums = new int[] { 1, 2 };

            ArrayProgram.RotateArray(ref nums, 1);

            CollectionAssert.AreEqual(new int[] { 2, 1 }, nums);
        }
示例#2
0
        public void RotateEmptyArray()
        {
            int[] nums = new int[] { };

            ArrayProgram.RotateArray(ref nums, 3);

            CollectionAssert.AreEqual(new int[] { }, nums);
        }
示例#3
0
        public void RotateSimpleArrayTest()
        {
            int[] nums = new int[] { 1, 2, 3, 4, 5 };

            ArrayProgram.RotateArray(ref nums, 3);

            CollectionAssert.AreEqual(new int[] { 4, 5, 1, 2, 3 }, nums);
        }