public void New_ReturnsAViewResult_True() { //Arrange WordCountController controller = new WordCountController(); //Act ActionResult newView = controller.New("Cool", "Cool!"); //Assert Assert.IsInstanceOfType(newView, typeof(ViewResult)); }
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)); }
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"); }