예제 #1
0
        public ActionResult DeleteWaiter(int id)
        {
            var action = new DeleteWaiterAction <ActionResult>(ServiceRegistry)
            {
                OnComplete = () => RedirectToAction("ManageWaiters"),
                OnFailure  = (errors) => EditFailed(id, errors)
            };

            return(action.Invoke(id, ResolveRestaurantId()));
        }
예제 #2
0
        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"));
        }