Пример #1
0
        public void WipeIndexTest()
        {
            const int elementSize = 10;
            IPersistentCollectionSpaceManager pafs = InitPAFS("PCSMWipeIndex", elementSize, 8);

            try
            {
                int    block   = pafs.AllocateBlock();
                byte[] putData = new byte[elementSize] {
                    255, 255, 255, 255, 255, 255, 255, 255, 255, 255
                };
                pafs.Put(block, putData);
                //make sure the data was written
                TestHelper.AssertByteArraysAreSame(putData, pafs.Get(block));

                pafs.WipeElement(block);
                TestHelper.AssertByteArraysAreSame(new byte[elementSize], pafs.Get(block));
            }
            finally
            {
                pafs.Close();
            }
        }
        private LinkedListElement GetElementAt(int arrayIndex)
        {
            LinkedListElement lle = LinkedListElement.Deserialize(_persistentSimpleCollection.Get(arrayIndex), arrayIndex);

            return(lle);
        }