public void DeleteScript() { IList <IGhostRunnerScript> project1ScriptsBefore = _scriptService.GetAllProjectGhostRunnerScripts(1); Assert.AreEqual(3, project1ScriptsBefore.Count); Boolean updateSuccessfull = _scriptService.DeleteScript("5a768553-052e-47ee-bf48-68f8aaf9cd05"); Assert.IsTrue(updateSuccessfull); IList <IGhostRunnerScript> project1ScriptsAfter = _scriptService.GetAllProjectGhostRunnerScripts(1); Assert.AreEqual(2, project1ScriptsAfter.Count); Boolean updateFailed = _scriptService.DeleteScript("99"); Assert.IsFalse(updateFailed); }
public ActionResult DeleteScript(String id, ConfirmDeleteScriptModel confirmDeleteScriptModel) { Script script = _scriptService.GetScript(id); if (script != null) { String projectId = script.Project.ExternalId; _scriptService.DeleteScript(id); return(RedirectToAction("Index/" + projectId, "Scripts")); } else { return(RedirectToAction("Index", "Main")); } }