public void RemoveTicketCallsRepositoryDeleteTicketWithTheSameTicketNumber() { _repository = Substitute.For <ITicketRepository>(); _mgr = new TicketManager(_repository); _mgr.RemoveTicket(5); _repository.Received(1).DeleteTicket(5); }
public ActionResult Delete(int id, FormCollection collection) { try { mgr.RemoveTicket(id); return(RedirectToAction("Index")); } catch { return(View()); } }
public IHttpActionResult Delete(int id) { Ticket ticketToDelete = mgr.GetTicket(id); if (ticketToDelete == null) { return(NotFound()); } mgr.RemoveTicket(id); return(StatusCode(HttpStatusCode.NoContent)); }
static void Main(string[] args) { PrintAllTickets(); mgr.RemoveTicket(1); Ticket t = mgr.GetTicket(1); if (t != null) { Console.WriteLine("Ticket {0} has not been removed!"); } Console.WriteLine("Ticket has been removed!\n"); PrintAllTickets(); Console.ReadLine(); }
public IActionResult DeleteConfirmed(int id) { mgr.RemoveTicket(id); return(RedirectToAction("Index")); }
public void RemoveTicket(int ticketNumber) { mgr.RemoveTicket(ticketNumber); }