Exemplo n.º 1
0
        public void Test_SubGrid_AllChangesMigrated()
        {
            ISubGrid leafSubgrid = null;

            SubGridTree tree = new SubGridTree(SubGridTreeConsts.SubGridTreeLevels, 1.0, new SubGridFactory <NodeSubGrid, LeafSubGrid>());

            leafSubgrid = new SubGrid(tree, null, SubGridTreeConsts.SubGridTreeLevels);

            Assert.False(leafSubgrid.Dirty, "Leaf is Dirty after creation");
            leafSubgrid.SetDirty();
            Assert.True(leafSubgrid.Dirty, "Leaf is not Dirty after setting Dirty to true");
            leafSubgrid.AllChangesMigrated();
            Assert.False(leafSubgrid.Dirty, "Leaf is Dirty after AllChangesMigrated");
        }
Exemplo n.º 2
0
        public void Test_SubGrid_LeafSubgridProperties()
        {
            ISubGrid    leafSubgrid = null;
            SubGridTree tree        = new SubGridTree(SubGridTreeConsts.SubGridTreeLevels, 1.0, new SubGridFactory <NodeSubGrid, LeafSubGrid>());

            // Create a new base subgrid leaf instance directly
            leafSubgrid = new SubGrid(tree, null, SubGridTreeConsts.SubGridTreeLevels);

            Assert.True(leafSubgrid.IsLeafSubGrid());

            Assert.False(leafSubgrid.Dirty);
            Assert.Equal(leafSubgrid.Level, SubGridTreeConsts.SubGridTreeLevels);
            Assert.Equal(leafSubgrid.AxialCellCoverageByThisSubGrid(), SubGridTreeConsts.SubGridTreeDimension);

            Assert.Equal(0, leafSubgrid.OriginX);
            Assert.Equal(0, leafSubgrid.OriginY);
            Assert.Equal("0:0", leafSubgrid.Moniker());

            // Does the dirty flag change?
            leafSubgrid.SetDirty();
            Assert.True(leafSubgrid.Dirty, "Leaf sub grid is not marked as dirty after setting it to dirty");
        }