Exemple #1
0
        public void Test_SubGridTreeBitMask_RemoveLeafOwningCell()
        {
            var mask = new SubGridTreeBitMask();

            // Check removing non-existing leaf is a null op
            mask.RemoveLeafOwningCell(0, 0);

            // Add a cell (causing a leaf to be added), then remove it
            mask[0, 0] = true;
            mask.CountBits().Should().Be(1);
            mask.CountLeafSubGridsInMemory().Should().Be(1);

            mask.RemoveLeafOwningCell(0, 0);
            mask.CountBits().Should().Be(0);
            mask.CountLeafSubGridsInMemory().Should().Be(0);
        }