Esempio n. 1
0
        public void Delete()
        {
            long capacity         = 10 * 1024 * 1024;
            SparseMemoryStream ms = new SparseMemoryStream();

            ms.SetLength(capacity);
            Geometry           geom  = Geometry.FromCapacity(capacity);
            BiosPartitionTable table = BiosPartitionTable.Initialize(ms, geom);

            Assert.AreEqual(0, table.Create(1 * 1024 * 1024, WellKnownPartitionType.WindowsFat, false));
            Assert.AreEqual(1, table.Create(2 * 1024 * 1024, WellKnownPartitionType.WindowsFat, false));
            Assert.AreEqual(2, table.Create(3 * 1024 * 1024, WellKnownPartitionType.WindowsFat, false));

            long[] sectorCount = new long[] { table[0].SectorCount, table[1].SectorCount, table[2].SectorCount };

            table.Delete(1);

            Assert.AreEqual(2, table.Count);
            Assert.AreEqual(sectorCount[2], table[1].SectorCount);
        }