public void TestDeleteIssueType() { using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.SQLConnectionString)) { connection.Open(); DeleteTables(connection); int ID = -1; string name = "Test"; Create(connection, ID, name); IssueTypeService issueTypeService = new IssueTypeService(); IssueTypeItem issueTypeItem = new IssueTypeItem { IssueTypeID = ID }; issueTypeService.DeleteIssueType(issueTypeItem); int count = GetCount(connection); Assert.AreEqual(count, 0); } }
public ActionResult IssueTypeDelete([DataSourceRequest] DataSourceRequest request, IssueTypeItem issueTypeItem) { if (issueTypeItem != null) { service.DeleteIssueType(issueTypeItem); } return(Json(new[] { issueTypeItem }.ToDataSourceResult(request, ModelState))); }