Esempio n. 1
0
        public void About()
        {
            // Setup
            HomeController controller = new HomeController();

            // Execute
            ViewResult result = controller.About() as ViewResult;

            // Verify
            ViewDataDictionary viewData = result.ViewData as ViewDataDictionary;

            Assert.AreEqual("About Page", viewData["Name"]);
        }
Esempio n. 2
0
        public void Index()
        {
            // Setup
            HomeController controller = new HomeController();

            // Execute
            ViewResult result = controller.Index() as ViewResult;

            // Verify
            ViewDataDictionary viewData = result.ViewData as ViewDataDictionary;

            Assert.AreEqual("Home Page", viewData["Name"]);
            Assert.AreEqual("Welcome to ASP.NET MVC!", viewData["Message"]);
        }