public void Index_ReturnsCorrectView_True() { WordsController controller = new WordsController(); ActionResult indexView = controller.Index(); Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Index_HasCorrectModelView_True() { // WordsController is singular here but plural in the Controllers file. Test failed if both matched? WordsController controller = new WordsController(); ActionResult indexView = controller.Index(); Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Index_HasCorrectModelType_WordandPhraseList() { //Arrange WordsController controller = new WordsController(); ViewResult indexView = controller.Index() as ViewResult; //Act var result = indexView.ViewData.Model; //Assert Assert.IsInstanceOfType(result, typeof(List <Word>)); }
public void Index_HasCorrectModelType_WordsList() { //Arrange Words myWords = new Words("cat", "the cat in the hat"); WordsController controller = new WordsController(); ViewResult indexView = controller.Index() as ViewResult; //Act var result = indexView.ViewData.Model; //Assert Assert.IsInstanceOfType(result, typeof(List <Words>)); }