Beispiel #1
0
        void SampleDataTest()
        {
            var a = new[] { 3, 8, 9, 7, 6 };
            var k = 3;

            var solution = new CyclicRotationSolution();
            var expected = new[] { 9, 7, 6, 3, 8 };

            Assert.Equal(expected, solution.Solution(a, k));
        }
Beispiel #2
0
        void EmptyDataTest()
        {
            var a = new int[] {};
            var k = 3;

            var solution = new CyclicRotationSolution();
            var expected = new int[] {};

            Assert.Equal(expected, solution.Solution(a, k));
        }
Beispiel #3
0
        void CyclesEqualDataLengthTest()
        {
            var a = new[] { 1, 2, 3, 4 };
            var k = 4;

            var solution = new CyclicRotationSolution();
            var expected = new[] { 1, 2, 3, 4 };

            Assert.Equal(expected, solution.Solution(a, k));
        }
Beispiel #4
0
        void MoreCyclesThanDataLengthTest()
        {
            var a = new[] { 3, 8, 9, 7, 6 };
            var k = 8;

            var solution = new CyclicRotationSolution();
            var expected = new[] { 9, 7, 6, 3, 8 };

            Assert.Equal(expected, solution.Solution(a, k));
        }
Beispiel #5
0
        void TheSameNumberTest()
        {
            var a = new[] { 0, 0, 0 };
            var k = 1;

            var solution = new CyclicRotationSolution();
            var expected = new[] { 0, 0, 0 };

            Assert.Equal(expected, solution.Solution(a, k));
        }