AssertViewRendered for action returning View()

157 views
Skip to first unread message

Daniel Lidström

unread,
Jul 5, 2011, 4:51:45 PM7/5/11
to mvccontri...@googlegroups.com
Hello,

I'm verifying an action returning View() with AssertViewRendered().ForView(string.Empty). Is this correct?
Here's my action method:
        public ActionResult ChangePasswordSuccess()
        {
            return View();
        }

and the test:

        [Fact]
        public void ChangePasswordSuccessReturnsView()
        {
            var controller = new AccountController();
            var result = controller.ChangePasswordSuccess();
            result.AssertViewRendered().ForView(string.Empty);
        }

/Daniel

Jeremy Skinner

unread,
Jul 6, 2011, 2:27:15 AM7/6/11
to mvccontri...@googlegroups.com
Looks correct to me. Is there something not working?

Jeremy Skinner
Sent from my iPhone
--
Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project. Or go to http://mvccontrib.org
 
To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en

Daniel Lidström

unread,
Jul 6, 2011, 3:54:29 PM7/6/11
to mvccontri...@googlegroups.com
Ok good. I simply wanted to know if this was the intended way. Thanks!

/Daniel
Reply all
Reply to author
Forward
0 new messages