Ejemplo n.º 1
0
        public void DecoratorPatter_GetIngredient_thinCrust_Onion()
        {
            ThinCrust           thinCrust           = new ThinCrust();
            OnionPizzaDecorator onionPizzaDecorator = new OnionPizzaDecorator(thinCrust);

            var response = onionPizzaDecorator.GetIngrendients();

            Assert.Equal(2, response.Count);
            Assert.Contains("wheat", response);
            Assert.Contains("onion", response);
        }
Ejemplo n.º 2
0
        public void DecoratorPatter_GetIngredient_thikCrust_Cheese_Onion()
        {
            ThikCrust            thikCrust            = new ThikCrust();
            CheesePizzaDecorator cheesePizzaDecorator = new CheesePizzaDecorator(thikCrust);
            OnionPizzaDecorator  onionPizzaDecorator  = new OnionPizzaDecorator(cheesePizzaDecorator);

            var response = onionPizzaDecorator.GetIngrendients();

            Assert.Equal(4, response.Count);
            Assert.Contains("wheat", response);
            Assert.Contains("extra wheat", response);
            Assert.Contains("cheese", response);
            Assert.Contains("onion", response);
        }