public static void Remove() { var distributedArray = new BigArray <int>(); int size = 4 * MaxBlockSize; var checkList = new List <int>(size); for (int i = 0; i < size; i++) { distributedArray.Add(i); checkList.Add(i); } //Remove last element of first block Assert.IsTrue(distributedArray.Remove(MaxBlockSize - 1)); checkList.Remove(MaxBlockSize - 1); Assert.AreEqual(distributedArray.Count, checkList.Count); //Remove first element of second block Assert.IsTrue(distributedArray.Remove(MaxBlockSize)); checkList.Remove(MaxBlockSize); Assert.AreEqual(distributedArray.Count, checkList.Count); Assert.IsTrue(distributedArray.Remove(0)); checkList.Remove(0); Assert.AreEqual(distributedArray.Count, checkList.Count); Assert.IsTrue(distributedArray.Remove(distributedArray.Count - 1)); checkList.Remove(checkList.Count - 1); Assert.AreEqual(distributedArray.Count, checkList.Count); //Try to remove nonexistent elements Assert.IsFalse(distributedArray.Remove(0)); Assert.IsFalse(distributedArray.Remove(size)); Assert.IsFalse(distributedArray.Remove(MaxBlockSize)); Assert.IsFalse(distributedArray.Remove(-1)); CheckEqual(distributedArray, checkList); }