Пример #1
0
        public void RotateLeftMultipleIterations()
        {
            var       testArray     = new[] { 1, 2, 3, 4, 5 };
            const int testDirection = -30;

            var expected = new[] { 1, 2, 3, 4, 5 };
            var actual   = ArrayRotation.Rotate(testArray, testDirection);

            CollectionAssert.AreEqual(expected, actual);
        }
Пример #2
0
        public void RotateRight()
        {
            var       testArray     = new[] { 1, 2, 3, 4, 5 };
            const int testDirection = 2;

            var expected = new[] { 4, 5, 1, 2, 3 };
            var actual   = ArrayRotation.Rotate(testArray, testDirection);

            CollectionAssert.AreEqual(expected, actual);
        }