public void ShouldComplexSalad_Cost13()
        {
            _saladDecorator = new SaladDecorator();
            _saladDecorator.ChooseSalad(new Iceberg());
            _saladDecorator.AddTopping(new ChickPeas());
            _saladDecorator.AddTopping(new Avocado());
            _saladDecorator.AddTopping(new Chicken());

            var salad = _saladDecorator.GetSalad();

            Assert.AreEqual(13, salad.GetPrice());
        }
        public void ShouldSimpleSalad_Cost7()
        {
            _saladDecorator = new SaladDecorator();
            _saladDecorator.ChooseSalad(new Batavia());
            _saladDecorator.AddTopping(new ChickPeas());

            var salad = _saladDecorator.GetSalad();

            Assert.AreEqual(8, salad.GetPrice());
        }
        public IIngredient GetSalad()
        {
            var _saladDecorator = new SaladDecorator();

            _saladDecorator = new SaladDecorator();
            _saladDecorator.ChooseSalad(new Batavia());
            _saladDecorator.AddTopping(new ChickPeas());

            return(_saladDecorator.GetSalad());
        }
 public void ShouldAdditionOfToppingWithoutSalad_ThrowException()
 {
     _saladDecorator = new SaladDecorator();
     _saladDecorator.AddTopping(new Chicken());
 }
Beispiel #5
0
 public void AddSaladTopping(ITopping topping)
 {
     _saladDecorator.AddTopping(topping);
 }