Пример #1
0
        public void IndexShouldReturn204NoContentHeader()
        {
            // Arrange
            var controller = new HomeController();

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

            // Assert
            var viewResult = Assert.IsType<HttpStatusCodeResult>(result);
            Assert.Equal(viewResult.StatusCode, 204);
        }
Пример #2
0
        public void IndexShouldReturnRedirectToInformationRoute()
        {
            // Arrange
            var controller = new HomeController();

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

            // Assert
            var viewResult = Assert.IsType<RedirectToRouteResult>(result);
            Assert.Equal(viewResult.RouteValues["action"], "Index");
            Assert.Equal(viewResult.RouteValues["controller"], "Information");
        }