public void MyTestMethod()
 {
     IBeverage beverage = new Espresso();
     beverage = new Mocha(beverage); // add mocha
     beverage = new Mocha(beverage); // add mocha again
     beverage = new Soy(beverage); // add soy too
     Assert.AreEqual<string>("Espresso, Mocha, Mocha, Soy", beverage.Description);
 }
 public void EspressoCondimentsCost()
 {
     IBeverage beverage = new Espresso();
     beverage = new Mocha(beverage); // add mocha
     beverage = new Mocha(beverage); // add mocha again
     beverage = new Soy(beverage); // add soy too
     Assert.AreEqual<double>(2.79, beverage.Cost());
 }
Example #3
0
        static void Main(string[] args)
        {
            Beverage myEspresso = new Espresso();
            myEspresso = new Mocha(myEspresso);
            myEspresso = new Soy(myEspresso);
            myEspresso = new Whip(myEspresso);

            Console.WriteLine(myEspresso.getDescription() + " " + myEspresso.cost());

            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            Beverage espresso = new Espresso();
            Console.WriteLine(espresso.getDescription()+ " $" + espresso.cost());

            Beverage houseBlend = new HouseBlend();
            houseBlend = new Mocha(houseBlend);
            houseBlend= new Mocha(houseBlend);
            houseBlend = new Soy(houseBlend);
            Console.WriteLine(houseBlend.getDescription() + " $" + houseBlend.cost());

            Console.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            Beverage espresso = new Espresso();

            Console.WriteLine(espresso.getDescription() + " $" + espresso.cost());

            Beverage houseBlend = new HouseBlend();

            houseBlend = new Mocha(houseBlend);
            houseBlend = new Mocha(houseBlend);
            houseBlend = new Soy(houseBlend);
            Console.WriteLine(houseBlend.getDescription() + " $" + houseBlend.cost());

            Console.ReadLine();
        }
Example #6
0
        static void Main(string[] args)
        {
            Beverage doubleMilkEspresso = new Espresso(BeverageSize.Large);

            doubleMilkEspresso = new Milk(doubleMilkEspresso);
            doubleMilkEspresso = new Milk(doubleMilkEspresso);
            Console.WriteLine(doubleMilkEspresso.Description);
            Console.WriteLine(doubleMilkEspresso.Cost());

            Beverage milkEspresso = new Espresso(BeverageSize.Small);

            milkEspresso = new Milk(milkEspresso);
            Console.WriteLine(milkEspresso.Description);
            Console.WriteLine(milkEspresso.Cost());
        }
Example #7
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            beverage = new Mocha(beverage);
            Console.WriteLine(beverage.GetDescription() + "$" + beverage.Cost());

            Beverage beverage1 = new HouseBlend();

            beverage1 = new Mocha(beverage1);
            //beverage1 = new Mocha(beverage1);
            //beverage1 = new Soy(beverage1);
            //beverage1 = new Soy(beverage1);
            Console.WriteLine(beverage1.GetDescription() + "$" + beverage1.Cost());
        }
        static void Main(string[] args)
        {
            var espresso = new Espresso();

            Console.WriteLine($"{espresso.AsString()} costs {espresso.Cost()} $");

            var espressoWithMilk = new WithMilk(espresso);

            Console.WriteLine($"{espressoWithMilk.AsString()} costs {espressoWithMilk.Cost()} $");

            var espressoWithMilkAndSugar = new WithSugar(espressoWithMilk);

            Console.WriteLine($"{espressoWithMilkAndSugar.AsString()} costs {espressoWithMilkAndSugar.Cost()} $");

            Console.ReadKey();
        }
Example #9
0
        static void Main(string[] args)
        {
            var firstOrder       = new MilkDecorator(new SugarDecorator(new Espresso()));
            var billOfFirstOrder = $"Price of {firstOrder.GetDescription()} is {firstOrder.GetCost()} dollars";

            var secondOrder       = new Espresso();
            var billOfSecondOrder = $"Price of {secondOrder.GetDescription()} is {secondOrder.GetCost()} dollars";

            var thirdOrder       = new SugarDecorator(new SugarDecorator(new MilkDecorator(new Espresso())));
            var billOfThirdOrder = $"Price of {thirdOrder.GetDescription()} is {thirdOrder.GetCost()} dollars";


            Console.WriteLine(billOfFirstOrder);
            Console.WriteLine(billOfSecondOrder);
            Console.WriteLine(billOfThirdOrder);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("We have these fabulous drinkings.");

            Beverage espresso    = new Espresso();
            Beverage latte       = new Latte();
            Beverage orangejuice = new OrangeJuice();

            Console.WriteLine($"Espresso : {espresso.Description} \\.{espresso.Cost()}");
            Console.WriteLine($"Latte : {espresso.Description} \\.{latte.Cost()}");
            Console.WriteLine($"OrangeJuice : {espresso.Description} \\.{orangejuice.Cost()}");

            Beverage mochaLatte = new Mocha(new Latte());

            Console.WriteLine($"Mocha Latte : {mochaLatte.Description} \\.{mochaLatte.Cost()}");

            Console.ReadLine();
        }
Example #11
0
        static void Main()
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.Description + " $" + beverage.Cost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new MochaCondiment(beverage2);
            beverage2 = new MochaCondiment(beverage2);
            beverage2 = new WhipCondiment(beverage2);
            Console.WriteLine(beverage2.Description + " $" + beverage2.Cost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new MochaCondiment(beverage3);
            beverage3 = new WhipCondiment(beverage3);
            Console.WriteLine(beverage3.Description + " $" + beverage3.Cost());
        }
Example #12
0
        public static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost());

            Beverage c1 = new DarkRoast();

            c1 = new Mocha(c1);
            c1 = new Mocha(c1);
            c1 = new Whip(c1);
            Console.WriteLine(c1.GetDescription() + " $ " + c1.Cost());

            Beverage b3 = new HouseBlend();

            b3 = new Soy(b3);
            b3 = new Mocha(b3);
            b3 = new Whip(b3);
            Console.WriteLine(b3.GetDescription() + " $ " + b3.Cost());
        }
Example #13
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.Description + " $" + beverage.Cost());

            Beverage beverage1 = new DarkRoast();

            beverage1 = new Mocha(beverage1);
            beverage1 = new Mocha(beverage1);
            beverage1 = new Whip(beverage1);
            Console.WriteLine(beverage1.Description + " $" + beverage1.Cost());

            Beverage beverage2 = new HouseBlend();

            beverage2 = new Soy(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.Description + " $" + beverage2.Cost());
        }
Example #14
0
        static void Main()
        {
            Beverage espresso = new Espresso();

            Console.WriteLine($"{espresso.GetDescription()} ${espresso.Cost()}");

            Beverage darkRoast = new DarkRoast();

            darkRoast = new Mocha(darkRoast);
            darkRoast = new Mocha(darkRoast);
            darkRoast = new Whip(darkRoast);
            Console.WriteLine($"{darkRoast.GetDescription()} ${darkRoast.Cost()}");

            Beverage houseBlend = new HouseBlend();

            houseBlend = new Soy(houseBlend);
            houseBlend = new Mocha(houseBlend);
            houseBlend = new Whip(houseBlend);
            Console.WriteLine($"{houseBlend.GetDescription()} ${houseBlend.Cost()}");
        }
Example #15
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.GetDescription() + " $" + beverage.Cost());

            Beverage darkRoast = new DarkRoast();

            darkRoast = new Mocha(darkRoast);
            darkRoast = new Mocha(darkRoast);
            darkRoast = new Whip(darkRoast);
            Console.WriteLine(darkRoast.GetDescription() + " $" + darkRoast.Cost());

            Beverage houseBlend = new HouseBlend();

            houseBlend = new Soya(houseBlend);
            houseBlend = new Mocha(houseBlend);
            houseBlend = new Whip(houseBlend);
            Console.WriteLine(houseBlend.GetDescription() + " $" + houseBlend.Cost());
        }
Example #16
0
        static void Main(string[] args)
        {
            var beverage = new Espresso();

            Console.WriteLine($"{beverage.Description} $ {beverage.Cost()}");

            Beverage beverage2 = new HouseBlend();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine($"{beverage2.Description} $ {beverage2.Cost()}");


            Beverage beverage3 = new Espresso();

            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine($"{beverage2.Description} $ {beverage2.Cost()}");
        }
        static void Main(string[] args)
        {
            IBeverage beverage = new Espresso();

            Console.WriteLine(beverage.Description + " $" + beverage.Cost());

            IBeverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.Description + " $" + beverage2.Cost());

            IBeverage beverage3 = new DarkRoast();

            beverage3 = new Milk(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.Description + " $" + beverage3.Cost());
        }
Example #18
0
        static void Main(string[] args)
        {
            IBeverage coffee = new Espresso();

            Console.WriteLine($"{coffee.Description}: £{coffee.Cost}");

            coffee = new DarkRoast();
            coffee = new Mocha(coffee);
            coffee = new Mocha(coffee);
            coffee = new Whip(coffee);

            Console.WriteLine($"{coffee.Description}: £{coffee.Cost}");

            //or, decorating decorators ...

            coffee = new Vanilla(new Mocha(new Mocha(new DarkRoast())));
            Console.WriteLine($"{coffee.Description}: £{coffee.Cost}");

            Console.ReadKey();
        }
Example #19
0
        static void Main(string[] args)
        {
            IBeverage beverage = new Espresso();

            Console.WriteLine(beverage.description + " $" + beverage.cost());

            IBeverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.description + " $" + beverage2.cost());

            IBeverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.description + " $" + beverage3.cost());
            Console.ReadLine();
        }
Example #20
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);

            Console.WriteLine(beverage2.getDescription() + " £" + beverage2.cost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);

            Console.WriteLine(beverage3.getDescription() + " £" + beverage3.cost());

            Console.ReadKey();
        }
Example #21
0
        static void Main(string[] args)
        {
            Console.WriteLine("Starbuzz Coffee");

            Beverage beverage = new Espresso();

            Console.WriteLine($"{beverage.Description} : ${beverage.Cost()}");

            Beverage beverage1 = new DarkRoast();

            beverage1 = new Mocha(beverage1);
            beverage1 = new Mocha(beverage1);
            beverage1 = new Whip(beverage1);
            Console.WriteLine($"{beverage1.Description} : ${beverage1.Cost()}");

            Beverage beverage2 = new HouseBlend();

            beverage2 = new Soy(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine($"{beverage2.Description} : ${beverage2.Cost()}");
        }
Example #22
0
        static void Main(string[] args)
        {
            PrintMenu();

            // Order an espresso with no condiments
            Beverage beverage1 = new Espresso();

            Console.WriteLine(beverage1);

            // Order a dark roast with double mocha & whip on top
            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2);

            // House blend with soy mocha & whip
            Beverage beverage3 = new Whip(new Mocha(new Soy(new HouseBlend())));

            Console.WriteLine(beverage3);
        }
Example #23
0
        public Beverage MakeBeverage(BEVERAGE_TYPE bt, List <CONDIMENT_TYPE> clist)
        {
            switch (bt)
            {
            case BEVERAGE_TYPE.ESPRESSO:
            {
                Beverage item = new Espresso();
                item = ApplyCondiment(clist, item);
                return(item);
            }

            case BEVERAGE_TYPE.DRAKROAST:
            {
                Beverage item = new DarkRoast();
                item = ApplyCondiment(clist, item);
                return(item);
            }

            default:
                return(null);
            }
        }
Example #24
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine($"{beverage.Description} $ {beverage.Cost()}");

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine($"{beverage2.Description} $ {beverage2.Cost()}");


            Beverage beverage3 = new DarkRoast();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine($"{beverage3.Description} $ {beverage3.Cost()}");

            Console.Read();
        }
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            beverage = new Venti(beverage);
            Console.WriteLine(beverage.GetDescription() + " $" + beverage.Cost());

            Beverage beverage5 = new Espresso();

            beverage5 = new Grande(beverage5);

            Console.WriteLine(beverage5.GetDescription() + " $" + beverage5.Cost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Grande(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.GetDescription() + " $" + beverage2.Cost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Venti(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.GetDescription() + " $" + beverage3.Cost());

            Beverage beverage4 = new Decaf();

            beverage4 = new Tall(beverage4);
            beverage4 = new Milk(beverage4);
            beverage4 = new Soy(beverage4);
            beverage4 = new Whip(beverage4);
            Console.WriteLine(beverage4.GetDescription() + " $" + beverage3.Cost());
        }
Example #26
0
        static void Main(string[] args)
        {
            Beverage one = new DarkRoast();

            one.setSize("tall");
            one = new Mocha(one);
            one = new Mocha(one);
            Console.WriteLine(one.getDesciption().ToString() + ": ${0}", one.cost().ToString());

            Beverage two = new Espresso();

            two.setSize("grande");
            Console.WriteLine(two.getDesciption().ToString() + ": ${0}", two.cost().ToString());

            Beverage three = new HouseBlend();

            three.setSize("venti");
            three = new Soy(three);
            three = new Mocha(three);
            three = new Whip(three);
            Console.WriteLine(three.getDesciption() + ": ${0}", three.cost());

            Console.Read();
        }
Example #27
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Default;

            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.Description + " - Price: " + beverage.Cost() + " €");

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);

            Console.WriteLine(beverage2.Description + " - Price: " + beverage2.Cost() + " €");

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);

            Console.WriteLine(beverage3.Description + " - Price: " + beverage3.Cost() + " €");
        }
        public void should_pay_7_when_buy_espresso_with_mocha()
        {
            var espresso = new Espresso(false, true);

            Assert.Equal(7.0, espresso.Cost());
        }
        public void should_pay_1_when_buy_espresso()
        {
            var espresso = new Espresso(false,false);

               Assert.Equal(4.0, espresso.Cost());
        }
        public void should_pay_5_when_buy_espresso_with_milk()
        {
            var espresso = new Espresso(true,false);

            Assert.Equal(5.0, espresso.Cost());
        }
        public void should_pay_8_when_buy_espresso_with_milk_and_mocha()
        {
            var espresso = new Espresso(true, true);

            Assert.Equal(8.0, espresso.Cost());
        }
        public void should_return_espresso_when_get_espresso_description()
        {
            var espresso = new Espresso(false, false);

            Assert.Equal("Espresso", espresso.GetDescription());
        }