protected void DeleteButton_Click(object sender, EventArgs e) { Query q = QueryRepository.FindById(DataUtility.ParseInt(QueryString["queryid"])); QueryRepository.Delete(q); Response.Redirect("~/admin/queries.aspx"); }
public void DeleteQuery() { // Arrange int ElementsCountBeforeAct = queriesDbSet.Count(); string deletedQueryName = queriesDbSet.First().SqlQueryName; int queryIdToDelete = queriesDbSet.First().SqlQueryId; // Act queryRepo.Delete(queryIdToDelete); // Assert Assert.AreNotEqual(ElementsCountBeforeAct, queriesDbSet.Count()); Assert.IsTrue(ElementsCountBeforeAct > queriesDbSet.Count()); foreach (SqlQuery query in queriesDbSet) { Assert.IsFalse(query.SqlQueryName == deletedQueryName); } }
public void Delete(string id) { _queryRepository.Delete(id); }