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

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

            Assert.IsNull(result);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }