public void Copy() { if (!TestHelper.GetDlcPath(out string dlcPath)) { return; } var ope = new UoeDatabaseOperator(dlcPath); var stPath = Path.Combine(TestFolder, "copysource.st"); File.WriteAllText(stPath, $"b .\nd \"Schema Area\" \"{TestFolder}\""); var srcDb = GetDb("copysource"); var tgtDb = GetDb("copytarget"); ope.Create(srcDb, stPath); Assert.IsTrue(srcDb.Exists()); ope.Copy(tgtDb, srcDb, false, false); Assert.IsTrue(tgtDb.Exists()); ope.Delete(tgtDb); Assert.IsFalse(tgtDb.Exists()); ope.Copy(tgtDb, srcDb); Assert.IsTrue(tgtDb.Exists()); }
public void Backup_Restore() { if (!TestHelper.GetDlcPath(out string dlcPath)) { return; } var ope = new UoeDatabaseOperator(dlcPath); var db = GetDb("backuprest"); ope.Copy(db, new UoeDatabaseLocation(Path.Combine(dlcPath, "sports2000"))); Assert.IsTrue(db.Exists()); var backupPath = Path.Combine(TestFolder, "backup.bkp"); ope.Backup(db, backupPath); ope.Delete(db); Assert.IsFalse(db.Exists()); ope.Restore(db, backupPath); Assert.IsTrue(db.Exists()); }