public RedirectToRouteResult Delete_POST(OrderNote orderNote) { if (orderNote.Order != null) { _orderNoteService.Delete(orderNote); return(RedirectToAction("Edit", "Order", new { id = orderNote.Order.Id })); } else { return(RedirectToAction("Index", "Order")); } }
public void OrderNoteController_DeletePOST_ShouldCallDeleteForThePassedOrderNote() { var item = new OrderNote(); item.Order = new Order { Id = 1 }; var delete = _orderNoteController.Delete_POST(item); A.CallTo(() => _orderNoteService.Delete(item)).MustHaveHappened(); }