Наследование: BaseController
Пример #1
0
        public void Contact()
        {
            // Arrange
            using (HomeController controller = new HomeController())
            {
                // Act
                ViewResult result = controller.Contact() as ViewResult;

                // Assert
                Assert.IsNotNull(result);
            }
       }
        public void Index()
        {
            // Anordnen
            HomeController controller = new HomeController();

            // Aktion ausführen
            ViewResult result = controller.Index() as ViewResult;

            // Bestätigen
            Assert.IsNotNull(result);
            Assert.AreEqual("Home Page", result.ViewBag.Title);
        }
Пример #3
0
        public void About()
        {
            // Arrange
            using (HomeController controller = new HomeController())
            {
                // Act
                ViewResult result = controller.About() as ViewResult;

                // Assert
                Assert.AreEqual("Your application description page.", result.ViewBag.Message);
            }
        }