public void DeletePrice_PriceEntityDelete_RepositoryMethodWereCalled() { //Arrange Guid guid = Guid.NewGuid(); //Act priceService.DeletePrice(guid); //Assert Prices.Verify( x => x.Delete(It.IsAny <Price>())); }
public ActionResult DeletePricing(int ID, String buttonname) { try { IPriceService PricingService = new PriceService(); bool deleteStatus = PricingService.DeletePrice(ID); if (deleteStatus == true) { return(RedirectToAction("ManagePricings", "Administration")); } else { ModelState.AddModelError("", "Failed to delete the record"); } } catch (Exception Ex) { ModelState.AddModelError("", Common.StandardExceptionErrorMessage(Ex)); } // If we got this far, something failed, redisplay form return(View()); }