Ejemplo n.º 1
0
        public void RemoveTests()
        {
            Assert.AreEqual(true, blockInfo.IsFull);

            blockInfo.RemoveData(5);
            blockInfo.RemoveData(4);
            blockInfo.RemoveData(6);
            Assert.AreEqual(false, blockInfo.Check(5));
            Assert.AreEqual(false, blockInfo.Check(4));
            Assert.AreEqual(false, blockInfo.Check(6));

            Assert.AreEqual(5, blockInfo.AddData());
            Assert.AreEqual(4, blockInfo.AddData());
            Assert.AreEqual(6, blockInfo.AddData());

            for (int i = 0; i < BlockInfo.BlockSize; i++)
            {
                blockInfo.RemoveData(i);
            }
            Assert.AreEqual(true, blockInfo.IsEmpty);
            for (int i = 0; i < BlockInfo.BlockSize; i++)
            {
                Assert.AreEqual(i, blockInfo.AddData());
            }
            Assert.AreEqual(true, blockInfo.IsFull);
        }