示例#1
0
        public void RotateRightTest_EmptyInput()
        {
            var solution = new _061_RotateList();
            var result   = solution.RotateRight(null, 3);

            Assert.IsNull(result);
        }
示例#2
0
        public void RotateRightTest_EmptyInput()
        {
            var solution = new _061_RotateList();
            var result = solution.RotateRight(null, 3);

            Assert.IsNull(result);
        }
示例#3
0
        public void RotateRightTest_LargeK()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 2, 3 });

            var solution = new _061_RotateList();
            var result   = solution.RotateRight(input, 2000000000);

            AssertHelper.AssertLinkList(new int[] { 2, 3, 1 }, result);
        }
示例#4
0
        public void RotateRightTest()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 2, 3, 4, 5 });

            var solution = new _061_RotateList();
            var result   = solution.RotateRight(input, 3);

            AssertHelper.AssertLinkList(new int[] { 3, 4, 5, 1, 2 }, result);
        }
示例#5
0
        public void RotateRightTest_OneItem()
        {
            var input = TestHelper.GenerateList(new int[] { 1 });

            var solution = new _061_RotateList();
            var result   = solution.RotateRight(input, 5);

            AssertHelper.AssertLinkList(new int[] { 1 }, result);
        }
示例#6
0
        public void RotateRightTest_LargeK()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 2, 3 });

            var solution = new _061_RotateList();
            var result = solution.RotateRight(input, 2000000000);

            AssertHelper.AssertLinkList(new int[] { 2, 3, 1 }, result);
        }
示例#7
0
        public void RotateRightTest_KLessThanZero()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 2, 3, 4, 5 });

            var solution = new _061_RotateList();
            var result = solution.RotateRight(input, -1);

            AssertHelper.AssertLinkList(new int[] { 1, 2, 3, 4, 5 }, result);
        }
示例#8
0
        public void RotateRightTest_KLargerThanLenght()
        {
            var input = TestHelper.GenerateList(new int[] { 1, 2, 3, 4, 5 });

            var solution = new _061_RotateList();
            var result = solution.RotateRight(input, 6);

            AssertHelper.AssertLinkList(new int[] { 5, 1, 2, 3, 4 }, result);
        }
示例#9
0
        public void RotateRightTest_OneItem()
        {
            var input = TestHelper.GenerateList(new int[] { 1 });

            var solution = new _061_RotateList();
            var result = solution.RotateRight(input, 5);

            AssertHelper.AssertLinkList(new int[] { 1 }, result);
        }