public void RedirectToActionIndex__WhenFoodCategoryIsSuccessfullyDeleted()
        {
            //Arrange
            var               foodCategoriesServiceMock = new Mock <IFoodCategoriesService>();
            var               mappingServiceMock        = new Mock <IMappingService>();
            var               controller    = new FoodCategoriesController(foodCategoriesServiceMock.Object, mappingServiceMock.Object);
            var               id            = Guid.NewGuid();
            string            name          = null;
            FoodType          foodType      = FoodType.Vegetable;
            MeasuringUnitType measuringUnit = MeasuringUnitType.Kg;

            var foodcategory = new FoodCategory()
            {
                Id            = id,
                Name          = name,
                FoodType      = foodType,
                MeasuringUnit = measuringUnit
            };

            foodCategoriesServiceMock.Setup(x => x.GetFoodCategoryById(id)).Returns(foodcategory);
            foodCategoriesServiceMock.Setup(x => x.DeleteFoodCategory(foodcategory));

            //Act & Assert
            controller.WithCallTo(x => x.DeleteFoodCategoryConfirm(id))
            .ShouldRedirectTo(x => x.Index());
        }
        public void RenderTheRightView_DeleteFoodCategory__WhenFoodCategoryWasNotFoundInDatabase()
        {
            //Arrange
            var foodCategoriesServiceMock = new Mock <IFoodCategoriesService>();
            var mappingServiceMock        = new Mock <IMappingService>();
            var controller = new FoodCategoriesController(foodCategoriesServiceMock.Object, mappingServiceMock.Object);
            var id         = Guid.NewGuid();

            foodCategoriesServiceMock.Setup(x => x.GetFoodCategoryById(id)).Returns <FoodCategory>(null);

            //Act & Assert
            controller.WithCallTo(x => x.DeleteFoodCategory(id))
            .ShouldRenderView("DeleteFoodCategory");
        }