public void Show_ReturnsViewResult_True() { IngredientsController controller = new IngredientsController(); Ingredient newIngredient = new Ingredient("celery", 5); newIngredient.Save(); int id = newIngredient.GetId(); ViewResult showView = controller.Show(id) as ViewResult; Assert.IsInstanceOfType(showView, typeof(ViewResult)); }
public void Show_HasCorrectModelType_DictionaryStringObject() { IngredientsController controller = new IngredientsController(); Ingredient newIngredient = new Ingredient("celery", 5); newIngredient.Save(); int id = newIngredient.GetId(); ViewResult showView = controller.Show(id) as ViewResult; var result = showView.ViewData.Model; Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>)); }