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 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());
        }
Example #4
0
 public void ChooseSalad(ISalad salad)
 {
     _saladDecorator.ChooseSalad(salad);
 }