Beispiel #1
0
        public void RotateLeft_Scenario1_Rotate2Times()
        {
            //Arrange
            int[] firstArray = new int[] { 1, 2, 3, 4, 5 };
            int   rotations  = 2;

            int[] expected = new int[] { 3, 4, 5, 1, 2 };

            //Act
            var actual = _solution.RotateLeft(firstArray, rotations);

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void Sample()
        {
            var input    = Array.ConvertAll("1 2 3 4 5".Split(' '), int.Parse);
            var rotation = 4;

            var actual = _sut.RotateLeft(input, rotation);

            Assert.Equal(5, actual[0]);
            Assert.Equal(1, actual[1]);
            Assert.Equal(2, actual[2]);
            Assert.Equal(3, actual[3]);
            Assert.Equal(4, actual[4]);
        }