Exemple #1
0
        public void Shift_CountIsTooLarge()
        {
            int[] array = { 0, 0 };
            int   count = 3;

            Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Shift(ref array, count));
        }
Exemple #2
0
        public void Shift_EmptyArray()
        {
            int[] array = { };
            int   count = 1;

            Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Shift(ref array, count));
        }
Exemple #3
0
        public byte[] PositiveShiftOfSmallArray()
        {
            byte[] array = new byte[100];

            NArr.Shift(ref array, 1);

            return(array);
        }
Exemple #4
0
        public byte[] NegativeShiftOfLargeArray()
        {
            byte[] array = new byte[100000];

            NArr.Shift(ref array, -1);

            return(array);
        }
Exemple #5
0
        public void Shift_IsExpected()
        {
            int[] array = { 0, 1, 2, 3, 4, 5, 6, 7 };
            int   count = 3;

            int[] expected = { 5, 6, 7, 0, 1, 2, 3, 4 };
            NArr.Shift(ref array, count);

            Assert.AreEqual(expected, array);
        }