コード例 #1
0
        public void RotateArrayWith8ItemsSixteenTimes()
        {
            int[] inputArr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            int[] expected = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            int[] actual   = RotateArrayLib.RotateN(inputArr, 16);
            bool  isEqual  = arraysAreEqual(actual, expected);

            Assert.IsTrue(isEqual);
        }
コード例 #2
0
        public void RotateArrayWith4ItemsTwice()
        {
            int[] inputArr = new int[] { 1, 2, 3, 4 };
            int[] expected = new int[] { 3, 4, 1, 2 };
            int[] actual   = RotateArrayLib.RotateN(inputArr, 2);
            bool  isEqual  = arraysAreEqual(actual, expected);

            Assert.IsTrue(isEqual);
        }