예제 #1
0
        public void New_ReturnsAViewResult_True()
        {
            //Arrange
            WordCountController controller = new WordCountController();

            //Act
            ActionResult newView = controller.New("Cool", "Cool!");

            //Assert
            Assert.IsInstanceOfType(newView, typeof(ViewResult));
        }
예제 #2
0
        public void New_HasCorrectModelType_WordCountObject()
        {
            //Arrange
            WordCountController controller = new WordCountController();
            ViewResult          newView    = controller.New("Cool", "Cool!") as ViewResult;

            //Act
            var result = controller.ViewData.Model;

            //Assert
            Assert.IsInstanceOfType(result, typeof(WordCount));
        }
예제 #3
0
        public void New_ReturnsCorrectActionType_Index()
        {
            //Arrange
            WordCountController controller = new WordCountController();
            ViewResult          viewResult = controller.New("Cool", "Cool!") as ViewResult;

            //Act
            string result = viewResult.ViewName;

            //Assert
            Assert.AreEqual(result, "Index");
        }