public void InsertTwoElementInObjectArrayWithDefaltConstructor() { var array = new ArrayClass<string>(); var count = array.GetCount(); array.Insert("m", count); count = array.GetCount(); Assert.AreEqual(1, count); array.Insert("c", count); count = array.GetCount(); Assert.AreEqual(2, count); }
public void InsertStringElementInObjectArrayWithLength8() { var data = new string[] { "a", "b", "d", "c", "f", null, null, null }; var newElement = "m"; var array = new ArrayClass<string>(data, 8); array.Insert(newElement, 2); var count = array.GetCount(); Assert.AreEqual(9, count); }
public void InsertIntElementInObjectArrayWithLength8() { var data = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; var newElement = 1; var array = new ArrayClass<int>(data, 8); array.Insert(newElement, 2); var count = array.GetCount(); Assert.AreEqual(9, count); }
public void InsertIntElementInObjectArrayWithIndexOutOfRAnge() { var intArray = new int[] { 1, 2, 3, 0, 0, 0, 0, 0 }; var newElement = 5; var array = new ArrayClass<int>(intArray, 3); array.Insert(newElement, 10); var count = array.GetCount(); Assert.AreEqual(3, count); }
public void InsertIntElementInObjectArrayWithElementOfIndexNull() { var intArray = new int[] { 1, 2, 3, 0, 0, 0, 0, 0 }; var newElement = 5; var array = new ArrayClass<int>(intArray, 3); array.Insert(newElement, 4); var count = array.GetCount(); Assert.AreEqual(4, count); }
public void InsertIntElementInObjectArray() { var intArray = new int[] { 1, 2, 3, 0, 0, 0, 0, 0 }; var newElement = 1; var array = new ArrayClass<int>(intArray, 3); array.Insert(newElement, 2); var count = array.GetCount(); var data = array.GetData(2); Assert.AreEqual(4, count); Assert.AreEqual(1, data); }