예제 #1
0
        public void ShouldRedirectToAcceptedViewOnSuccessfulApplication()
        {
            var sut = new HomeController();

            var application = new Application
            {
                IsAccepted = true
            };

            sut.WithCallTo(x => x.Index(application)).ShouldRedirectTo(x => x.Accepted);
        }
예제 #2
0
        public ActionResult Index(Application application)
        {
            if (!ModelState.IsValid)
            {
                return View(application);
            }

            if (application.IsAccepted)
            {
                return RedirectToAction("Accepted");
            }
            else
            {
                return RedirectToAction("Rejected");
            }
        }