public void Create_HasCorrectModelType_newCounter() { ViewResult createView = new WordCountersController().Create("word", "target word") as ViewResult; var result = createView.ViewData.Model; Assert.IsInstanceOfType(result, typeof(Counter)); }
public void Create_ReturnsCorrectView_True() { WordCountersController controller = new WordCountersController(); ActionResult newView = controller.Create("targetWord", "string targetPhrase"); Assert.IsInstanceOfType(newView, typeof(ViewResult)); }
public void New_ReturnsCorrectView_True() { WordCountersController controller = new WordCountersController(); ActionResult newView = controller.New(); Assert.IsInstanceOfType(newView, typeof(ViewResult)); }
public void Index_ReturnsCorrectView_True() { //Arrange WordCountersController controller = new WordCountersController(); //Act ActionResult indexView = controller.Index(); //Assert Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Create_ReturnsCorrectActionType_RedirectToActionResult() { //Arrange WordCountersController controller = new WordCountersController(); //Act IActionResult view = controller.Create("alive", "I am alive"); //Assert Assert.IsInstanceOfType(view, typeof(ViewResult)); }
public void Index_HasCorrectModelType_ItemList() { //Arrange ViewResult indexView = new WordCountersController().Index() as ViewResult; //Act var result = indexView.ViewData.Model; //Assert Assert.IsInstanceOfType(result, typeof(List <RepeatCounter>)); }