示例#1
0
        public byte[] SmallCollectionInSmallArray()
        {
            byte[] array = new byte[100];

            NArr.Move(ref array, 0, 50, 49);

            return(array);
        }
示例#2
0
        public void Move_CountIsTooLarge()
        {
            int[] array = { 0, 1 };
            int   from  = 0;
            int   count = 3;
            int   to    = 0;

            Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Move(ref array, from, count, to));
        }
示例#3
0
        public void Move_ToIndexIsTooSmall()
        {
            int[] array = { 0, 1 };
            int   from  = 0;
            int   count = 1;
            int   to    = -1;

            Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Move(ref array, from, count, to));
        }
示例#4
0
        public void Move_EmptyArray()
        {
            int[] array = { };
            int   from  = 0;
            int   count = 1;
            int   to    = 1;

            Assert.Throws <ArgumentException>(() => NArr.Move(ref array, from, count, to));
        }
示例#5
0
        public void Move_NullArray()
        {
            int[] array = null;
            int   from  = 0;
            int   count = 1;
            int   to    = 1;

            Assert.Throws <ArgumentNullException>(() => NArr.Move(ref array, from, count, to));
        }
示例#6
0
        public void Move_ArrayLengthEqualsOne()
        {
            int[] array = { 0 };
            int   from  = 0;
            int   count = 1;
            int   to    = 0;

            int[] expected = { 0 };
            NArr.Move(ref array, from, count, to);

            Assert.AreEqual(expected, array);
        }
示例#7
0
        public void Move_CountEqualsZero()
        {
            int[] array = { 0, 1, 2, 3, 4, 5, 6, 7 };
            int   from  = 1;
            int   count = 0;
            int   to    = 5;

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

            Assert.AreEqual(expected, array);
        }