public void FillArrayTest()
        {
            int             length      = 1000;
            IArray <string> vectorArray = new FactorArray <string>(length);

            ArrayTestPack.addValues(vectorArray, length);
            Assert.IsTrue(vectorArray.Size() == length, "Массив не соответствующей длинны");
        }
Exemplo n.º 2
0
        public void Add_AddThousandIntElements_AddsElements()
        {
            var array = new FactorArray <int>();

            for (var i = 0; i < 1000; i++)
            {
                array.Add(i);
            }

            Assert.AreEqual(1000, array.Size);
        }
Exemplo n.º 3
0
        public void Get_GetElementAtSpecificIndex_GetsTheElement()
        {
            var array = new FactorArray <int>();

            for (var i = 0; i < 1000; i++)
            {
                array.Add(i);
            }

            Assert.AreEqual(10, array.Get(10));
        }
Exemplo n.º 4
0
        public void Remove_RemoveElementAtNotExistingIndex_ThrowsException()
        {
            var array = new FactorArray <int>();

            for (var i = 0; i < 1000; i++)
            {
                array.Add(i);
            }

            Assert.ThrowsException <IndexOutOfRangeException>(() =>
            {
                array.Remove(1000);
            });
        }
Exemplo n.º 5
0
        public void Remove_RemoveElementAtIndex_RemovesTheElement()
        {
            var array = new FactorArray <int>();

            for (var i = 0; i < 1000; i++)
            {
                array.Add(i);
            }

            var item = array.Remove(75);

            Assert.AreEqual(999, array.Size);
            Assert.AreEqual(75, item);
        }
Exemplo n.º 6
0
        public void Add_AddElementAtSpecificIndex_AddsElement()
        {
            var array = new FactorArray <int>();

            for (var i = 0; i < 1000; i++)
            {
                array.Add(i);
            }

            array.Add(9999, 10);

            Assert.AreEqual(1001, array.Size);
            Assert.AreEqual(9999, array.Get(10));
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            IArray <int> single = new SingleArray <int>();
            IArray <int> vector = new VectorArray <int>(1000);
            IArray <int> factor = new FactorArray <int>();
            IArray <int> matrix = new MatrixArray <int>();
            IArray <int> space  = new SpaceArray <int>();;

            TestPut(single, 1000);
            TestPut(vector, 1000);
            TestPut(factor, 1000);
            TestPut(matrix, 1000);
            TestPut(space, 1000);

            Console.ReadLine();
        }