Ejemplo n.º 1
0
        public void ExcutionTest()
        {
            var func = new Rotate();

            var source = new[] { 1, 2, 3, 4, 5, 6 };

            func.Excution(source, 2);
            Assert.IsTrue(new[] { 5, 6, 1, 2, 3, 4 }.AreEqual(source));

            source = new[] { 1, 2 };
            func.Excution(source, 2);
            Assert.IsTrue(new[] { 1, 2 }.AreEqual(source));

            source = new[] { 1, 2, 3, 4, 5, 6, 7 };
            func.Excution(source, 3);
            Assert.IsTrue(new[] { 5, 6, 7, 1, 2, 3, 4 }.AreEqual(source));

            source = new[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            func.Excution(source, 6);
            Assert.IsTrue(new[] { 3, 4, 5, 6, 7, 8, 1, 2 }.AreEqual(source));
        }