public void DeleteWithIdOf0() { int id = 0; Exception ex = Assert.ThrowsException <ArgumentException>(() => motdService.DeleteMOTD(id)); Assert.AreEqual("ID requires to be greater than 0.", ex.Message); }
public ActionResult <MOTD> Delete(int id) { try { return(Ok(_MOTDServices.DeleteMOTD(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }