public ActionResult DeleteWaiter(int id) { var action = new DeleteWaiterAction <ActionResult>(ServiceRegistry) { OnComplete = () => RedirectToAction("ManageWaiters"), OnFailure = (errors) => EditFailed(id, errors) }; return(action.Invoke(id, ResolveRestaurantId())); }
public void EnsureGuardAgainstNullOnComplete() { var error = ""; try { var action = new DeleteWaiterAction <dynamic>(A.Fake <IServiceRegistry>()) { }; action.Invoke(1, 1); } catch (Exception ex) { error = ex.Message; } Assert.IsTrue(error.Contains("OnComplete")); }