예제 #1
0
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        Query q = QueryRepository.FindById(DataUtility.ParseInt(QueryString["queryid"]));

        QueryRepository.Delete(q);

        Response.Redirect("~/admin/queries.aspx");
    }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public void Delete(string id)
 {
     _queryRepository.Delete(id);
 }