public void DeleteSpecialOfferWithNoId() { var id = 0; Exception ex = Assert.ThrowsException <ArgumentException>(() => SpecielOffersService.DeleteSpecialOffer(id)); Assert.AreEqual("Id need to be higher than 0", ex.Message); }
public ActionResult <SpecialOffers> Delete(int id) { try { return(Ok(_spclService.DeleteSpecialOffer(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }