public static void ResetDB() { RealmDBMgr.Initialize(); int count = CharacterRecord.GetCount(); if (count > 500) { throw new Exception("Cannot run tests on production servers since it requires to drop the complete Database. " + "Test run aborted because " + count + " Characters were found (must not be more than 500). Drop the Database manually to proceed."); } DatabaseUtil.DropSchema(); DatabaseUtil.CreateSchema(); }
public static void TearDown() { // make sure we get rid of the Characters again (since we create so many) DatabaseUtil.DropSchema(); DatabaseUtil.CreateSchema(); }