ValidateSchema() public method

public ValidateSchema ( ) : bool
return bool
Example #1
0
        public void Migrate ()
        {
            Paths.ApplicationName = Application.InternalName;

            int count = 0;
            foreach (string file in Directory.GetFiles (Path.Combine (TestsDir, "data"))) {
                if (file.EndsWith (".db")) {
                    var db_file = file + ".test-tmp-copy";
                    try {
                        File.Delete (db_file);
                        File.Copy (file, db_file);

                        // Call the magic methods to test the migration path
                        var db = new BansheeDbConnection (db_file);
                        SortKeyUpdater.Disable = true;
                        ((IInitializeService)db).Initialize ();
                        Assert.IsTrue (db.ValidateSchema ());
                        count++;
                    } catch (Exception e) {
                        Assert.Fail (String.Format ("Failed to migrate db: {0}", e));
                    } finally {
                        File.Delete (db_file);
                    }
                }
            }
            Assert.IsTrue (count > 0);
        }
Example #2
0
        public void Migrate()
        {
            Application.InitializePaths();

            int count = 0;

            foreach (string file in Directory.GetFiles(Path.Combine(TestsDir, "data")))
            {
                if (file.EndsWith(".db"))
                {
                    var db_file = file + ".test-tmp-copy";
                    try {
                        File.Delete(db_file);
                        File.Copy(file, db_file);

                        // Call the magic methods to test the migration path
                        var db = new BansheeDbConnection(db_file);
                        SortKeyUpdater.Disable = true;
                        ((IInitializeService)db).Initialize();
                        Assert.IsTrue(db.ValidateSchema());
                        count++;
                    } catch (Exception e) {
                        Assert.Fail(String.Format("Failed to migrate db: {0}", e));
                    } finally {
                        File.Delete(db_file);
                    }
                }
            }
            Assert.IsTrue(count > 0);
        }