Example #1
0
        public static void Reverse()
        {
            var distributedArray = new BigArray <int>();

            for (int i = 0; i < MaxBlockSize * 2; i++)
            {
                distributedArray.Add(i);
            }
            distributedArray.Reverse();

            //Check
            int count = distributedArray.Count;

            for (int i = 0; i < count; i++)
            {
                Assert.AreEqual(i, distributedArray[count - 1 - i]);
            }

            //Empty array
            var newArray = new BigArray <int>();

            newArray.Reverse();

            newArray.Add(0); // This items are in the
            newArray.Add(1); // insuring block

            newArray.Reverse();

            Assert.AreEqual(newArray[0], 1);
            Assert.AreEqual(newArray[1], 0);
        }