forked from abishekaditya/DesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
24 lines (21 loc) · 795 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
namespace DecoratorPattern
{
static class Program
{
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());
}
}
}