public void Resize_NewSizeLessThanZero() { int[] array = { 0 }; int newSize = -1; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Resize(ref array, newSize)); }
public void AppendSingleElement() { byte[] array = new byte[0]; byte[] collection = new byte[1]; NArr.Append(ref array, collection); }
public void Shift_CountIsTooLarge() { int[] array = { 0, 0 }; int count = 3; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Shift(ref array, count)); }
public void AppendLargeCollection() { byte[] array = new byte[0]; byte[] collection = new byte[100000000]; NArr.Append(ref array, collection); }
public void Append_NullArray() { int[] array = null; int[] collection = { 6, 7 }; Assert.Throws <ArgumentNullException>(() => NArr.Append(ref array, collection)); }
public void Resize_NullArray() { int[] array = null; int newSize = 1; Assert.Throws <ArgumentNullException>(() => NArr.Resize(ref array, newSize)); }
public void Shift_EmptyArray() { int[] array = { }; int count = 1; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Shift(ref array, count)); }
public void Append_NullCollection() { int[] array = { 0, 1, 2, 3, 4, 5 }; int[] collection = null; Assert.Throws <ArgumentNullException>(() => NArr.Append(ref array, collection)); }
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)); }
public byte[] SmallArrayToLargerArray() { byte[] array = new byte[10]; NArr.Resize(ref array, 100); return(array); }
public void Insert_IndexIsTooSmall() { int[] array = { }; int[] collection = { }; int index = -1; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Insert(ref array, collection, index)); }
public void Insert_NullArray() { int[] array = null; int[] collection = { 3, 4 }; int index = 3; Assert.Throws <ArgumentNullException>(() => NArr.Insert(ref array, collection, index)); }
public void Remove_CountIsTooSmall() { int[] array = { 0 }; int count = -1; int index = 0; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Remove(ref array, count, index)); }
public byte[] SmallCollectionFromSmallArray() { byte[] array = new byte[100]; NArr.Remove(ref array, 10, 0); return(array); }
public byte[] LargeCollectionFromLargeArray() { byte[] array = new byte[100000]; NArr.Remove(ref array, 50000, 49999); return(array); }
public byte[] PositiveShiftOfSmallArray() { byte[] array = new byte[100]; NArr.Shift(ref array, 1); return(array); }
public byte[] NegativeShiftOfLargeArray() { byte[] array = new byte[100000]; NArr.Shift(ref array, -1); return(array); }
public void Remove_IndexIsTooLarge() { int[] array = { 0 }; int count = 1; int index = 1; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Remove(ref array, count, index)); }
public void Remove_EmptyArray() { int[] array = { }; int count = 0; int index = 0; Assert.Throws <ArgumentOutOfRangeException>(() => NArr.Remove(ref array, count, index)); }
public byte[] SmallCollectionInSmallArray() { byte[] array = new byte[100]; NArr.Move(ref array, 0, 50, 49); return(array); }
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)); }
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)); }
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)); }
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)); }
public byte[] SmallCollectionIntoEmptyArray() { byte[] array = new byte[0]; byte[] collection = new byte[100]; NArr.Insert(ref array, collection, 0); return(array); }
public byte[] LargeCollectionIntoLargeArray() { byte[] array = new byte[100000]; byte[] collection = new byte[100000]; NArr.Insert(ref array, collection, 49999); return(array); }
public void Resize_DecreaseSize_IsExpected() { int[] array = { 0, 1, 2, 3, 4, 5, 6, 7 }; int newSize = 7; int[] expected = { 0, 1, 2, 3, 4, 5, 6 }; NArr.Resize(ref array, newSize); Assert.AreEqual(expected, array); }
public void Append_IsExpected() { int[] array = { 0, 1, 2, 3, 4, 5 }; int[] collection = { 6, 7 }; int[] expected = { 0, 1, 2, 3, 4, 5, 6, 7 }; NArr.Append(ref array, collection); Assert.AreEqual(expected, array); }
public void Resize_ArrayLengthEqualsNewSize() { int[] array = { 0, 1, 2, 3, 4, 5, 6, 7 }; int newSize = 8; int[] expected = { 0, 1, 2, 3, 4, 5, 6, 7 }; NArr.Resize(ref array, newSize); Assert.AreEqual(expected, array); }
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); }