Пример #1
0
        public void Insert_IndexIsTooSmall()
        {
            int[] array      = { };
            int[] collection = { };
            int   index      = -1;

            Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Insert(ref array, collection, index));
        }
Пример #2
0
        public void Insert_NullCollection()
        {
            int[] array      = { 0, 1, 2, 5, 6, 7 };
            int[] collection = null;
            int   index      = 3;

            Assert.Throws <ArgumentNullException>(() => NArr.Insert(ref array, collection, index));
        }
Пример #3
0
        public void Insert_NullArray()
        {
            int[] array      = null;
            int[] collection = { 3, 4 };
            int   index      = 3;

            Assert.Throws <ArgumentNullException>(() => NArr.Insert(ref array, collection, index));
        }
Пример #4
0
        public byte[] SmallCollectionIntoEmptyArray()
        {
            byte[] array      = new byte[0];
            byte[] collection = new byte[100];

            NArr.Insert(ref array, collection, 0);

            return(array);
        }
Пример #5
0
        public byte[] LargeCollectionIntoLargeArray()
        {
            byte[] array      = new byte[100000];
            byte[] collection = new byte[100000];

            NArr.Insert(ref array, collection, 49999);

            return(array);
        }
Пример #6
0
        public void Insert_EmptyCollection()
        {
            int[] array      = { 0, 1, 2, 3, 4, 5, 6, 7 };
            int[] collection = { };
            int   index      = 3;

            int[] expected = { 0, 1, 2, 3, 4, 5, 6, 7 };

            NArr.Insert(ref array, collection, index);

            Assert.AreEqual(expected, array);
        }