コード例 #1
0
        public void MVC_Index_AngularJS_Json_ViewResult_ModelReturnedNull()
        {
            // Arrange
            _controller = new HomeController();
            // Act
            var actual = _controller.Index_AngularJS() as ViewResult;

            // Assert
            Assert.IsNull(actual.Model);
        }
コード例 #2
0
        public void MVC_Index_ViewResult_ViewExists()
        {
            // Arrange
            _controller = new HomeController();
            string expectedView = "Index";

            // Act
            var actual = _controller.Index() as ViewResult;
            // Assert
            Assert.AreEqual(expectedView, actual.ViewName);
        }
コード例 #3
0
        public void MVC_Index_ViewResult_ModelReturned()
        {
            // Arrange
            _controller = new HomeController();
            string expectedView = "Index";

            // Act
            var actual = _controller.Index() as ViewResult;
            var actualModel = actual.Model as BillModel;

            // Assert
            Assert.IsNotNull(actualModel);
            Assert.AreEqual(expectedView, actual.ViewName);
        }