ToDishModel() публичный Метод

public ToDishModel ( Dish dishData, string restId, int MenuPId, string lang = DefaultLang, RestaurantModel restaurantModel = null ) : DishModel
dishData Spontaneous.DataModel.Dish
restId string
MenuPId int
lang string
restaurantModel Spontaneous.WebApp.Models.RestaurantModel
Результат Spontaneous.WebApp.Models.DishModel
Пример #1
0
        public void ToViewModelTest_ShouldConverToViewModelRegularCarbohydrateLevel()
        {
            Dish dish1 = new Dish()
            {
                Name = "dish1",
                Description = "description1",
                NutritionFacts = new NutritionFacts() { TotalCarbohydrate = 2 },
                BaseLineNutritionFacts = new NutritionFacts() { TotalCarbohydrate = 1 }
            };

            ToViewModelConverter converter = new ToViewModel();

            DishModel dishModel1 = converter.ToDishModel(dish1, "111111");

            Assert.IsTrue(dishModel1.NutritionFacts.TotalCarbohydrate == 2);
        }
Пример #2
0
        public void ToViewModelTest_ShouldConverWithMenuPartIdParameter()
        {
            Dish dish1 = new Dish()
            {
                Name = "dish1",
                Description = "description1",
                NutritionFacts = new NutritionFacts() { TotalCarbohydrate = 2 },
                BaseLineNutritionFacts = new NutritionFacts() { TotalCarbohydrate = 1 }
            };

            ToViewModelConverter converter = new ToViewModel();

            DishModel dishModel1 = converter.ToDishModel(dish1, "111111", 3);

            Assert.IsTrue(dishModel1.MenuPartId == 3);
        }