public void CanUpgradeDbStucture()
        {
            using (var m = new XbimModel())
            {
                m.Open(@"Persistency\Monolith_v10.xBIM", XbimDBAccess.Exclusive);
                Assert.AreEqual(1, m.GeometrySupportLevel, "GeometrySupportLevel for Monolith_v10 should be 1");

                var updated = m.EnsureGeometryTables();
                Assert.AreEqual(updated, true, "Should complete returning true");

                m.DeleteGeometryCache();
                Assert.AreEqual(0, m.GeometrySupportLevel,
                    "GeometrySupportLevel for Monolith_v10 should be 0 after removing it.");

                m.Close();
            }
        }
        public void CanUpgradeDbStucture()
        {
            using (var m = new XbimModel())
            {
                m.Open(@"Persistency\Monolith_v10.xBIM", XbimDBAccess.Exclusive);
                Assert.AreEqual(1, m.GeometrySupportLevel, "GeometrySupportLevel for Monolith_v10 should be 1");

                var updated = m.EnsureGeometryTables();
                Assert.AreEqual(updated, true, "Should complete returning true");

                m.DeleteGeometryCache();
                Assert.AreEqual(0, m.GeometrySupportLevel,
                                "GeometrySupportLevel for Monolith_v10 should be 0 after removing it.");

                m.Close();
            }
        }
Пример #3
0
        public void GeometryVersionUpgradeTest()
        {
            using (var model = new XbimModel())
            {
                // start afresh
                model.Open(@"GConv\Monolith_v10.xBIM", XbimDBAccess.Exclusive);
                Assert.AreEqual(1, model.GeometrySupportLevel);

                // now remove the existing geometry
                model.DeleteGeometryCache();
                Assert.AreEqual(0, model.GeometrySupportLevel);

                // now create the geometry back
                model.EnsureGeometryTables(); // update the database structure first
                var context = new Xbim3DModelContext(model);
                context.CreateContext(XbimGeometryType.PolyhedronBinary); // then populate it

                // final tests
                Assert.AreEqual(2, model.GeometrySupportLevel);
                // and tidy up
                model.Close();
            }
        }
Пример #4
0
        public void GeometryVersionUpgradeTest()
        {
            using (var model = new XbimModel())
            {
                // start afresh
                model.Open(@"GConv\Monolith_v10.xBIM", XbimDBAccess.Exclusive);
                Assert.AreEqual(1, model.GeometrySupportLevel);

                // now remove the existing geometry
                model.DeleteGeometryCache();
                Assert.AreEqual(0, model.GeometrySupportLevel);

                // now create the geometry back
                model.EnsureGeometryTables();                             // update the database structure first
                var context = new Xbim3DModelContext(model);
                context.CreateContext(XbimGeometryType.PolyhedronBinary); // then populate it

                // final tests
                Assert.AreEqual(2, model.GeometrySupportLevel);
                // and tidy up
                model.Close();
            }
        }