public void TestGetDbStorage() { Storage storage = DaoHelper.Instance.DbStorage; Assert.IsNotNull(storage); ClothRoot root = (ClothRoot)storage.Root; Assert.IsNotNull(root); Assert.IsNotNull(root.ClothOidIndex); Assert.IsNotNull(root.ColorIndex); Assert.IsNotNull(root.ShapeIndex); DaoHelper.CloseDb(); }
static DaoHelper() { helper = new DaoHelper(); Storage storage = StorageFactory.Instance.CreateStorage(); storage.Open(DbConstants.DataBaseFilePath, DbConstants.PagePoolSize); ClothRoot root = (ClothRoot)storage.Root; if (root == null) { root = new ClothRoot(storage); storage.Root = root; // persist root object. storage.Commit(); } helper.storage = storage; }
public void TearDown() { DaoHelper.CloseDb(); }