public void Details_ReturnsARecipe_WhenTheRecipeIDIsVali()
        {
            //Arrange
                    var homeController = new HomeController(session);

                    var recipe1 = session.Query<Recipe>().SingleOrDefault(x => x.Title == "Title1");
            //Act
                    ViewResult result = homeController.Details(recipe1.ID) as ViewResult;
            //Assert
                    Assert.IsNotNull(result);

            //Act
                    var actual = result.Model as Recipe;
                    var expected = session.Query<Recipe>().SingleOrDefault(x => x.ID == recipe1.ID);
            //Assert
                    Assert.AreEqual(actual, expected);
        }
        public void Edit_ReturnsARecipeAndCanUpdateARecipe_WhenTheRecipeIDIsVali()
        {
            //Arrange
                    var homeController = new HomeController(session);

                    var recipe1 = session.Query<Recipe>().SingleOrDefault(x => x.Title == "Title1");
            //Act
                    ViewResult result = homeController.Edit(recipe1.ID) as ViewResult;
            //Assert
                    Assert.IsNotNull(result);

            //Act
                    var actual = result.Model as Recipe;
                    var expected = session.Query<Recipe>().SingleOrDefault(x => x.ID == recipe1.ID);
            //Assert
                    Assert.AreEqual(actual, expected);

                    //update step
            //Arrange
                    var updatedRecipe = new Recipe
                    {
                        Title = "Title1",
                        Description = "Description1",
                        ID = recipe1.ID,
                        //only the isIncorrect value cand be changet without being signed In
                        isIncorrect = false
                    };
            //Act
                    ViewResult resultOnUpdate = homeController.Edit(updatedRecipe) as ViewResult;

                    var expectedAfterUpdate = updatedRecipe;
                    homeController.Edit(updatedRecipe.ID);
                    var actualAfterUpdate = session.Query<Recipe>().SingleOrDefault(x => x.ID == updatedRecipe.ID);
             //Assert
                    Assert.AreEqual(actualAfterUpdate, expectedAfterUpdate);
        }
        public void Index_ReturnsListOfRecipes_WhenThereAreRecipesInDB()
        {
            //Arrange
                    var homeController = new HomeController(session);
            //Act
                    ViewResult result = homeController.Index() as ViewResult;
            //Assert
                    Assert.IsNotNull(result);

            //Act
                    var actual = result.Model as List<Recipe>;
                    var expected = session.Query<Recipe>().OrderBy(x => x.ID).ToList();
            //Assert
                    CollectionAssert.AreEqual(actual, expected);
        }