Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public ActionResult Index(Application application)
        {
            if (!ModelState.IsValid)
            {
                return View(application);
            }

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