Beispiel #1
0
        public void RotateSmallArray_Success()
        {
            var arr    = new int[] { -1 };
            var steps  = 2;
            var rotate = new RotateArray(arr, steps);

            rotate.PerformRotationWithAdditionalSpace();

            Assert.True(CheckArrayEquality(new int[] { -1 }, arr));
        }
Beispiel #2
0
        public void RotateFirstArray_SecondApproach_Success()
        {
            var arr    = new int[] { 1, 2, 3, 4, 5, 6, 7 };
            var steps  = 3;
            var rotate = new RotateArray(arr, steps);

            rotate.PerformRotationWithAdditionalSpace();


            Assert.True(CheckArrayEquality(new int[] { 5, 6, 7, 1, 2, 3, 4 }, arr));
        }