public void AddTrigger_WithValidDatabasePath_AddsTriggerToSpecifiedDatabase() { MainTreeHandler.AddTrigger("NewTrigger", DATABASEPATH1); var result = TreeSearcher.DatabaseHoldsItem <TriggerFolderItem>(testTree, "NewTrigger", DATABASEPATH1); Assert.IsTrue(result); }
public void AddTrigger_WithValidDatabasePath_DoesNotAddTriggerToDifferentDatabase() { MainTreeHandler.AddTrigger("NewTrigger", DATABASEPATH1); var result = TreeSearcher.DatabaseHoldsItem <TriggerFolderItem>(testTree, "NewTrigger", DATABASEPATH2); Assert.IsFalse(result); }
private void Create() { StatusInfo = string.Empty; using (var dbHandler = new DatabaseHandler(selectedDatabase.DatabasePath)) { try { dbHandler.ExecuteNonQuery(sql); StatusInfo = LocalisationHelper.GetString("TriggerCreator_StatusInfo_Success"); MainTreeHandler.AddTrigger(triggerName, selectedDatabase.DatabasePath); } catch (Exception ex) { logger.Error("An error occured when the user tried to create a trigger from the TriggerCreator.", ex); StatusInfo = ex.Message.Replace("SQL logic error or missing database\r\n", "SQL-Error - "); } } }
public void AddTrigger_WithInvalidDatabasePath_DoesNotThrowException() { Assert.DoesNotThrow( () => MainTreeHandler.AddTrigger("NewTrigger", "InvalidPath")); }