public static Models.PresetPizzas MapPresetPizza(PresetPizza pizza) { return(new Models.PresetPizzas { PresetId = pizza.PresetId, PresetName = pizza.PresetName }); }
public IActionResult PresetPizzaSelected(PresetPizza presetPizza) { var pizzaType = client.GetAllPresetPizzas().FirstOrDefault(s => s.ID == presetPizza.ID); var sessionOrder = Utils.GetCurrentOrder(HttpContext.Session); sessionOrder.Pizzas.Add(new Pizza()); var currentPizza = sessionOrder.Pizzas.Last(); currentPizza.PresetPizza = pizzaType; currentPizza.Toppings = pizzaType.Toppings; Utils.SaveOrder(HttpContext.Session, sessionOrder); return(RedirectToAction("GetSize")); }
public void Test_GetPresetPizzaById() { PresetPizza sut = presetpizzarepository.GetPresetPizzaById(2); Assert.Equal(sut.Name, "Meaty"); }