public void Delete_noData_test() { bannerService.CreateBanner(0, "<div>divvvv</div>"); bannerController.Delete(0); var data = unit.BannerRepository.FindById(0); Assert.Null(data); }
protected void btnMultipleDelete_Click(object sender, EventArgs e) { //Get Ids string[] IDs = hdnFldSelectedValues.Value.Trim().Split('|'); string front_banner_dir = Server.MapPath(thumb_banner_dir_path); string main_banner_dir = Server.MapPath(main_banner_dir_path); //Code for deleting items foreach (string Item in IDs) { try { int id = int.Parse(Item.ToString()); int i = banner_obj.Delete(id, front_banner_dir, main_banner_dir); FillDataInGrid(); } catch (InvalidOperationException ef) { ef.ToString(); } } }