Index() публичный Метод

public Index ( ) : ActionResult,
Результат ActionResult,
Пример #1
0
        public void ReturnsIndexView()
        {
            //Arrage

            //Act
            var result = _AboutControllerUnderTest.Index() as ViewResult;

            //Assert
            Assert.IsInstanceOfType(result, typeof(ViewResult));
        }
        public void Index_ShouldExist()
        {
            var controller = new AboutController();
            var result     = controller.Index() as ViewResult;

            Assert.IsNotNull(result);
        }
        public void TestAboutControllerReturnsView()
        {
            AboutController ac = new AboutController();
            ViewResult      vr = (ViewResult)ac.Index();

            Assert.True(vr.ViewData.ModelState.IsValid);
        }
Пример #4
0
        public void Index_ReturnsView()
        {
            AboutController aboutController = new AboutController();
            ViewResult      viewResult      = (ViewResult)aboutController.Index();

            Assert.AreEqual("About", viewResult.ViewBag.Title);
        }
Пример #5
0
        public void TestAboutController()
        {
            var aboutController = new AboutController();

            var result = (ViewResult)aboutController.Index();

            Assert.NotNull(result);
        }
Пример #6
0
        public void About()
        {
            // Arrange
            AboutController controller = new AboutController();

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

            // Assert
            Assert.IsNotNull(result);
        }
Пример #7
0
        public void Get_ViewResult_Index_Test()
        {
            //Arrange
            AboutController controller = new AboutController();

            //Act
            var result = controller.Index();

            //Assert
            Assert.IsType <ViewResult>(result);
        }
Пример #8
0
        public void Index()
        {
            // Arrange
            AboutController controller = new AboutController();

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

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual("Home Page", result.ViewBag.Title);
        }
        public void Index_ReturnsAViewResult()
        {
            var controller = new AboutController();

            // Act
            var result = controller.Index();

            // Assert
            var viewResult = Assert.IsType <ViewResult>(result);

            Assert.NotNull(viewResult);
        }
Пример #10
0
 public void Index()
 {
     var view       = sut.Index();
     var viewresult = Assert.IsType <ViewResult>(view);
 }
Пример #11
0
        public void IndexView_DoesNotReturnNull()
        {
            var result = (ViewResult)controller.Index();

            Assert.IsNotNull(result);
        }