public void GetDishModelTest_ShouldReturnDishModelBackOfficeWithBaseLineNutritionFacts() { RestaurantModelBackOffice restBO = new RestaurantModelBackOffice(); Dish dish = new Dish() { Name = "TempDish", Description = "description", Id = 1, NutritionFacts = new NutritionFacts(), BaseLineNutritionFacts = new NutritionFacts() }; dish.NutritionFacts.TotalCarbohydrate = 20; dish.BaseLineNutritionFacts.TotalCarbohydrate = 33; var dishModel = (DishModelBackOffice)restBO.GetDishModel(dish, "111", false, "he"); Assert.IsNotNull(dishModel.BaseLineNutritionFacts); Assert.IsTrue(dishModel.BaseLineNutritionFacts.TotalCarbohydrate == 33); }
public void GetDishModelTest_ShouldReturnDishModelBackOfficeIfCalledFromRestaurantModelBackOffice() { RestaurantModelBackOffice restBO = new RestaurantModelBackOffice(); Dish dish = new Dish() { Name = "TempDish", Description = "description", Id = 1, NutritionFacts = new NutritionFacts(), BaseLineNutritionFacts = new NutritionFacts() }; dish.NutritionFacts.TotalCarbohydrate = 20; dish.BaseLineNutritionFacts.TotalCarbohydrate = 33; DishModel dishModel = restBO.GetDishModel(dish, "111", false, "he"); var type = dishModel.GetType(); Assert.IsTrue(type == typeof(DishModelBackOffice)); }