public void DecoratorPatter_GetIngredient_thikCrust() { ThikCrust thikCrust = new ThikCrust(); var response = thikCrust.GetIngrendients(); Assert.Equal(2, response.Count); Assert.Contains("wheat", response); Assert.Contains("extra wheat", response); }
public void DecoratorPatter_GetIngredient_thikCrust_Cheese() { ThikCrust thikCrust = new ThikCrust(); CheesePizzaDecorator cheesePizzaDecorator = new CheesePizzaDecorator(thikCrust); var response = cheesePizzaDecorator.GetIngrendients(); Assert.Equal(3, response.Count); Assert.Contains("wheat", response); Assert.Contains("extra wheat", response); Assert.Contains("cheese", response); }
public void DecoratorPatter_GetIngredient_thikCrust_Onion() { ThikCrust thikCrust = new ThikCrust(); OnionPizzaDecorator onionPizzaDecorator = new OnionPizzaDecorator(thikCrust); var response = onionPizzaDecorator.GetIngrendients(); Assert.Equal(3, response.Count); Assert.Contains("wheat", response); Assert.Contains("extra wheat", response); Assert.Contains("onion", response); }
public void DecoratorPattern_OnionWithCheeseThikCrust() { ThikCrust thikCrust = new ThikCrust(); CheesePizzaDecorator cheesePizzaDecorator = new CheesePizzaDecorator(thikCrust); OnionPizzaDecorator onionPizzaDecorator = new OnionPizzaDecorator(cheesePizzaDecorator); var respThikCrust = thikCrust.GetPrice(); var respCheeseWithThinCrust = cheesePizzaDecorator.GetPrice(); var respOnionWithCheeseAndThinCrust = onionPizzaDecorator.GetPrice(); Assert.Equal(250, respThikCrust); Assert.Equal(350, respCheeseWithThinCrust); Assert.Equal(450, respOnionWithCheeseAndThinCrust); }