Exemplo n.º 1
0
        public void GetNextIndexTest()
        {
            IPersistentCollectionSpaceManager pafs = InitPAFS("PCSMGetNextIndex", 16, 8);

            try
            {
                //should just wrap AllocateBlock()
                int block     = pafs.AllocateBlock();
                int nextSpace = pafs.GetNextIndex();
                Assert.AreEqual(block, nextSpace);

                pafs.Put(block, new byte[pafs.GetElementSize()]);

                int block2     = pafs.AllocateBlock();
                int nextSpace2 = pafs.GetNextIndex();
                Assert.AreEqual(block2, nextSpace2);
            }
            finally
            {
                pafs.Close();
            }
        }