public void AddIntElementInObjectArray()
        {
            var data = new int[] { 1, 2, 3, 0, 0, 0, 0, 0 };
            var newElement = 1;

            var array = new ArrayClass<int>(data, 3);
            array.Add(newElement);
            var count = array.GetCount();

            Assert.AreEqual(4, count);
        }
        public void AddIntElementInObjectArrayWithLength17()
        {
            var data = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
            var newElement = 17;

            var array = new ArrayClass<int>(data, 16);
            array.Add(newElement);
            var count = array.GetCount();

            Assert.AreEqual(17, count);
        }
        public void AddEightIntElementInObjectArray()
        {
            var array = new ArrayClass<int>();

            for (var i = 1; i <= 11; i++)
            {
                array.Add(i);
            }
            var count = array.GetCount();

            Assert.AreEqual(11, count);
        }
        public void AddOneIntElementInObjectArray()
        {
            var newElement = 1;

            var array = new ArrayClass<int>();
            array.Add(newElement);
            var count = array.GetCount();

            Assert.AreEqual(1, count);
        }
        public void RemoveNullElementInObjectArray()
        {
            var data = new int[] { 1, 2, 3, 4, 5, 6, 0 };

            var array = new ArrayClass<int>(data, 6);
            array.Remove(0);
            var count = array.GetCount();

            Assert.AreEqual(6, count);
        }
        public void RemoveNonExistentElementInObjectArray()
        {
            var data = new int[] { 1, 2, 3, 4, 5, 6, 0 };
            int elementToRemove = 7;

            var array = new ArrayClass<int>(data, 6);
            array.RemoveAt(elementToRemove);
            var count = array.GetCount();

            Assert.AreEqual(6, count);
        }
        public void RemoveElementFromOutOfBoundIndexInObjectArray()
        {
            var data = new int[] { 7, 6, 5, 4, 3, 2, 1 };

            var array = new ArrayClass<int>(data, 7);
            array.RemoveAt(8);
            var count = array.GetCount();

            Assert.AreEqual(7, count);
        }
        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);
        }
        public void AddStringElementInObjectArray()
        {
            var data = new string[] { "ana", "are", "mere", null, null, null, null, null };
            var newElement = "pere";

            var array = new ArrayClass<string>(data, 3);
            array.Add(newElement);
            var count = array.GetCount();

            Assert.AreEqual(4, count);
        }