Example #1
0
 public void AddTopping(ITopping top)
 {
     if (this.Toppings.Count <= this.MaxToppings)
     {
         this.Toppings.Add(top);
     }
 }
Example #2
0
 public Pizza(
     [Import(typeof(IDough))] IDough dough,
     [Import(typeof(ITopping))] ITopping topping)
 {
     this.Dough   = dough;
     this.Topping = topping;
 }
Example #3
0
 public void RemoveToppingFromMenu(ITopping toppingToRemoveFromMenu)
 {
     if (ListOfToppingsAvailableInMenu.Contains(toppingToRemoveFromMenu))
     {
         ListOfToppingsAvailableInMenu.Remove/*All*/ (toppingToRemoveFromMenu);
     }
 }
Example #4
0
 public void RemoveToppingFromCup(ITopping toppingToRemove)
 {
     if (CupOfToppings.Contains(toppingToRemove))
     {
         CupOfToppings.Remove(toppingToRemove);
     }
 }
Example #5
0
 public void AddToppingToMenu(ITopping toppingToAddToMenu)
 {
     if (!ListOfToppingsAvailableInMenu.Contains(toppingToAddToMenu))
     {
         ListOfToppingsAvailableInMenu.Add((ITopping)toppingToAddToMenu);
     }
 }
Example #6
0
 public HomeController(ISize sizeService, IDepth depthService, ITopping toppingService, IPizza pizzaService, IPizzaTopping pizzaToppingService)
 {
     _sizeService         = sizeService;
     _depthService        = depthService;
     _toppingService      = toppingService;
     _pizzaService        = pizzaService;
     _pizzaToppingService = pizzaToppingService;
 }
Example #7
0
        public void AddTopping(ITopping topping)
        {
            if (_ingredient == null)
            {
                throw new SaladNotFoundException();
            }

            topping.SetTopping(_ingredient);
            _ingredient = topping;
        }
        public void ShouldRoastedGarlicCalculateCostAs32Percent()
        {
            //Arrange
            ITopping subject = Topping.RoastedGarlic;

            //Act
            Money actual = subject.Cost(new Money(1));

            //Assert
            actual.Should().Be(new Money(0.32));
        }
        public void ShouldSunDriedTomatoCalculateCostAs32Percent()
        {
            //Arrange
            ITopping subject = Topping.SunDriedTomato;

            //Act
            Money actual = subject.Cost(new Money(1));

            //Assert
            actual.Should().Be(new Money(0.32));
        }
        public void ShouldFetaCheeseCalculateCostAs32Percent()
        {
            //Arrange
            ITopping subject = Topping.FetaCheese;

            //Act
            Money actual = subject.Cost(new Money(1));

            //Assert
            actual.Should().Be(new Money(0.32));
        }
Example #11
0
        public static Drink OrderDrink(DrinkType drinkType, ITopping topping)
        {
            Drink drink = null;

            switch (drinkType)
            {
            case DrinkType.Expresso:
                drink = new Expresso(topping.HasSugar, topping.HasMilk, topping.HasChocolate);
                break;

            case DrinkType.Tea:
                drink = new Tea(topping.HasSugar);
                break;

            case DrinkType.IceTea:
                drink = new IceTea(topping.HasSugar);
                break;

            default:
                throw new NotSupportedException();
            }

            return(drink);
        }
Example #12
0
 public void OneTimeSetup()
 {
     mockDataStore  = new Mock <ITempDataStore>();
     toppingService = new ToppingService(mockDataStore.Object);
 }
Example #13
0
 public void AddToppingToCup(ITopping toppingToAdd)
 {
     CupOfToppings.Add(toppingToAdd);
 }
Example #14
0
 public IPizza AddTopping(ITopping topping) => _type.Create(_toppings.Add(topping));
Example #15
0
 public IPizza RemoveTopping(ITopping topping) => _type.Create(_toppings.Remove(topping));
Example #16
0
 public void AddSaladTopping(ITopping topping)
 {
     _saladDecorator.AddTopping(topping);
 }
Example #17
0
 public ICalzone AddTopping(ITopping topping) => _type.Create(_toppings.Add(topping));
Example #18
0
 public ICalzone RemoveTopping(ITopping topping) => _type.Create(_toppings.Remove(topping));
Example #19
0
 public void AddTopping(ITopping topping) => toppings.Add(topping);
Example #20
0
 public IToppingable AddTopping(ITopping topping)
 {
     _ingredients.Add(topping);
     return(this);
 }
 public ToppingManager(IItemService <Item> itemService, ITopping toppingService)
 {
     this.itemService    = itemService;
     this.toppingService = toppingService;
 }