public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
        public void CategoryReturnErrorPageWhenCannotFindSelectedCategory()
        {
            var db = new FakeBlondsCookingContext();
            db.AddSet(FakeData.Categories);
            db.AddSet(FakeData.Recipes);
            HomeController controller = new HomeController(db);

            ViewResult result = controller.Category(100) as ViewResult;

            Assert.AreEqual("Error", result.ViewName);
        }
        public void CategoryReturnsCorrectNumberOfRecipesInSelectedCategory()
        {
            var db = new FakeBlondsCookingContext();
            db.AddSet(FakeData.Categories);
            db.AddSet(FakeData.Recipes);
            HomeController controller = new HomeController(db);

            ViewResult result = controller.Category(1) as ViewResult;
            IEnumerable<Recipe> model = result.Model as IEnumerable<Recipe>;
            Assert.AreEqual(9, model.Count());
        }
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.About() as ViewResult;

            // Assert
            Assert.AreEqual("Your application description page.", result.ViewBag.Message);
        }