コード例 #1
0
        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);
        }
コード例 #2
0
        public ActionResult <SpecialOffers> Delete(int id)
        {
            try
            {
                return(Ok(_spclService.DeleteSpecialOffer(id)));
            }

            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }