public void TestVersion04() { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Debug.WriteLine("Ethan ordered a " + pizza + "\n"); pizza = chicagoStore.OrderPizza("cheese"); Debug.WriteLine("Joel ordered a " + pizza + "\n"); pizza = nyStore.OrderPizza("clam"); Debug.WriteLine("Ethan ordered a " + pizza + "\n"); pizza = chicagoStore.OrderPizza("clam"); Debug.WriteLine("Joel ordered a " + pizza + "\n"); pizza = nyStore.OrderPizza("pepperoni"); Debug.WriteLine("Ethan ordered a " + pizza + "\n"); pizza = chicagoStore.OrderPizza("pepperoni"); Debug.WriteLine("Joel ordered a " + pizza + "\n"); pizza = nyStore.OrderPizza("veggie"); Debug.WriteLine("Ethan ordered a " + pizza + "\n"); pizza = chicagoStore.OrderPizza("veggie"); Debug.WriteLine("Joel ordered a " + pizza + "\n"); }
static void Main(string[] args) { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine("Ethan ordered a " + pizza._Name + "\n"); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine("Joel ordered a " + pizza._Name + "\n"); pizza = nyStore.OrderPizza("clam"); Console.WriteLine("Ethan ordered a " + pizza._Name + "\n"); pizza = chicagoStore.OrderPizza("clam"); Console.WriteLine("Joel ordered a " + pizza._Name + "\n"); pizza = nyStore.OrderPizza("pepperoni"); Console.WriteLine("Ethan ordered a " + pizza._Name + "\n"); pizza = chicagoStore.OrderPizza("pepperoni"); Console.WriteLine("Joel ordered a " + pizza._Name + "\n"); pizza = nyStore.OrderPizza("veggie"); Console.WriteLine("Ethan ordered a " + pizza._Name + "\n"); pizza = chicagoStore.OrderPizza("veggie"); Console.WriteLine("Joel ordered a " + pizza._Name + "\n"); Console.ReadLine(); }
static void Main(string[] args) { Pizza pizza; PizzaStore nyStore = new NYPizzaStore(); Console.Clear(); pizza = nyStore.OrderPizza("cheese"); System.Console.WriteLine(pizza.ToString()); System.Console.WriteLine("\r\n"); pizza = nyStore.OrderPizza("clam"); System.Console.WriteLine(pizza.ToString()); System.Console.WriteLine("\r\n"); }
public void TestNYStyleCheesePizza() { HeadFirstDesignPatterns.Factory.PizzaStore.PizzaStore nyStore = new NYPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); string pizzaPrepareReturn = "Preparing NY Style Sauce and Cheese Pizza\n" + "Tossing Thin Crust Dough\n" + "Adding Martinara Sauce\n" + "Adding toppings:\n" + "\tGreated Reggiano Cheese\n"; Assert.AreEqual(pizzaPrepareReturn, pizza.Prepare()); Assert.AreEqual("Bake for 25 minutes at 350 \n", pizza.Bake()); Assert.AreEqual("Cutting the pizza into diagonal slices \n", pizza.Cut()); Assert.AreEqual("Place pizza in official PizzaStore box \n", pizza.Box()); Assert.AreEqual("NY Style Sauce and Cheese Pizza", pizza.GetName()); }
private void OnStartButtonClick() { var factory = new NYPizzaStore(); var pizza = factory.OrderPizza(PizzaType.Cheese); Log.Print(pizza.GetName()); }
public static void Main(string[] args) { PizzaStoreWithAF.Stores.PizzaStore nyStore = new NYPizzaStore(); PizzaStoreWithAF.Stores.PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza; try { pizza = nyStore.OrderPizza("cheese"); WriteLine("Ethan ordered a {0} pizza\n", pizza.Name); WriteLine(pizza); pizza = chicagoStore.OrderPizza("clam"); WriteLine("Joel ordered a {0} pizza\n", pizza.Name); WriteLine(pizza); } catch (Exception x) { WriteLine("Exception caused by <{0}>", x.Message); } // Keep console open: ReadLine(); } // Main
public void TestNYStyleClamPizza() { HeadFirstDesignPatterns.AbstractFactory.PizzaStore.PizzaStore nyStore = new NYPizzaStore(); Pizza pizza = nyStore.OrderPizza("clam"); string pizzaPrepareReturn = "Preparing New York Style Clam Pizza\n" + "Thin Crust Dough\n" + "Marinara Sauce\n" + "Reggiano Cheese\n" + "Fresh Clams"; Assert.AreEqual(pizzaPrepareReturn, pizza.Prepare()); Assert.AreEqual("Bake for 25 minutes at 350 \n", pizza.Bake()); Assert.AreEqual("Cutting the pizza into diagonal slices \n", pizza.Cut()); Assert.AreEqual("Place pizza in official PizzaStore box \n", pizza.Box()); Assert.AreEqual("New York Style Clam Pizza", pizza.Name); }
static void Main(string[] args) { NYPizzaFactory factory = new NYPizzaFactory(); NYPizzaStore store = new NYPizzaStore(factory); store.OrderPizza("cheese"); }
public void CreateCheesePizza() { PizzaStore nyPizzaStore = new NYPizzaStore(); var pizzaDetails = nyPizzaStore.OrderPizza("cheese"); Console.WriteLine(pizzaDetails.Name + pizzaDetails.Bake() + pizzaDetails.Box() + pizzaDetails.Cut() + pizzaDetails.Prepare()); }
static void Main(string[] args) { PizzaStore nyPizzaStore = new NYPizzaStore(); PizzaStore chicagoPizzaStore = new ChicagoPizzaStore(); nyPizzaStore.OrderPizza(PizzaType.Cheese); chicagoPizzaStore.OrderPizza(PizzaType.Cheese); }
private static void FactoryExample2() { PizzaStore nyStore = new NYPizzaStore(); Pizza pizza = nyStore.OrderPizza(TypeOfPizza.Pepperoni); WriteLine($"Pizza {pizza.Name} lista para ser entregada a Rodrigo"); ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Pizza Chicago\n"); ChicagoPizzaStore chicagoPizzaStore = new ChicagoPizzaStore(); PizzaAbstract cheeseChicago = chicagoPizzaStore.OrderPizza("cheese"); PizzaAbstract clamChicago = chicagoPizzaStore.OrderPizza("clam"); Console.WriteLine("\nPizza New York\n"); NYPizzaStore nyPizzaStore = new NYPizzaStore(); PizzaAbstract cheeseNY = nyPizzaStore.OrderPizza("cheese"); PizzaAbstract clamNY = nyPizzaStore.OrderPizza("clam"); Console.ReadKey(); }
public void TestDriver() { AbstractPizzaStore nyStore = new NYPizzaStore(); AbstractPizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza(PizzaType.Cheese); Console.WriteLine($"Ethan ordered a {pizza} "); }
static void Main(string[] args) { PizzaStore ps = new NYPizzaStore(); ps.OrderPizza(PizzaType.CHEESE); Console.ReadKey(); }
static void Main(string[] args) { // Order a New York Chesse Pizza PizzaStore nyPizzaStore = new NYPizzaStore(); var pizza = nyPizzaStore.OrderPizza("cheese"); Console.WriteLine(pizza.name); Console.ReadKey(); }
//Abstract Factory Pattern Implementation example static void Main(string[] args) { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); var p = nyStore.OrderPizza("Cheese"); var p1 = chicagoStore.OrderPizza("Veggie"); var p2 = chicagoStore.OrderPizza("Clam"); var p3 = chicagoStore.OrderPizza("Veggie"); }
private void RunAbstractFactoryExample() { NYPizzaStore nyPizzaStore = new NYPizzaStore(); nyPizzaStore.OrderPizza("cheese"); ChicagoPizzaStore chicagoPizzaStore = new ChicagoPizzaStore(); chicagoPizzaStore.OrderPizza("cheese"); }
static void Main(string[] args) { ChicagoPizzaStore chicagoPizzaStore = new ChicagoPizzaStore(); chicagoPizzaStore.OrderPizza("cheese"); NYPizzaStore nYPizzaStore = new NYPizzaStore(); nYPizzaStore.OrderPizza("cheese"); }
static void Main(string[] args) { Pizza pizza; PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Console.Clear(); pizza = nyStore.OrderPizza("cheese"); System.Console.WriteLine("\r\n"); pizza = nyStore.OrderPizza("veggie"); System.Console.WriteLine("\r\n"); pizza = chicagoStore.OrderPizza("cheese"); System.Console.WriteLine("\r\n"); pizza = chicagoStore.OrderPizza("veggie"); System.Console.WriteLine("\r\n"); }
static void Main(string[] args) { PizzaStore nyStore = new NYPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine($"Ethan ordered a {pizza.GetName()}{Environment.NewLine}"); pizza = nyStore.OrderPizza("clam"); Console.WriteLine($"Joel ordered a {pizza.GetName()}{Environment.NewLine}"); PizzaStore chicagoStore = new ChicagoPizzaStore(); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine($"Ethan ordered a {pizza.GetName()}{Environment.NewLine}"); pizza = chicagoStore.OrderPizza("clam"); Console.WriteLine($"Joel ordered a {pizza.GetName()}{Environment.NewLine}"); }
public static void Start() { // New York Cheese Pizza PizzaStore nyPizzaStore = new NYPizzaStore(); nyPizzaStore.OrderPizza("cheese"); PizzaStore chicagoPizzaStore = new ChicagoPizzaStore(); chicagoPizzaStore.OrderPizza("cheese"); }
private void Main() { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Debug.Log("Jenny ordered a " + pizza.GetName()); pizza = chicagoStore.OrderPizza("cheese"); Debug.Log("John ordered a " + pizza.GetName()); }
static void Main(string[] args) { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza(PizzaType.Cheese); Console.WriteLine("Ethan ordered a " + pizza.Name + "\n"); pizza = chicagoStore.OrderPizza(PizzaType.Cheese); Console.WriteLine("Joel ordered a " + pizza.Name + "\n"); Console.ReadKey(); }
private static void RunFactoryPattern() { Console.WriteLine(@"------------------------------------------------------"); Console.WriteLine("\tPizza Store Factory Pattern Test"); Console.WriteLine(@"------------------------------------------------------"); PizzaStore chicagoPizzaStore = new CHPizzaStore(); PizzaStore newYorkPizzaStore = new NYPizzaStore(); chicagoPizzaStore.OrderPizza("Cheese"); Console.WriteLine("........................................"); chicagoPizzaStore.OrderPizza("Veggie"); Console.WriteLine("........................................"); chicagoPizzaStore.OrderPizza("Pepperoni"); Console.WriteLine("\n-----------------------------------------\n"); newYorkPizzaStore.OrderPizza("Cheese"); Console.WriteLine("........................................"); newYorkPizzaStore.OrderPizza("Veggie"); Console.WriteLine("........................................"); newYorkPizzaStore.OrderPizza("Pepperoni"); Console.WriteLine(@"------------------------------------------------------"); }
static void Main(string[] args) { PizzaStore pizzaStore = new NYPizzaStore(); var pizza = pizzaStore.OrderPizza("cheese"); Console.WriteLine("Name: " + pizza.Name + " Dough: " + pizza.Dough + " Sauce" + pizza.Sauce); PizzaStore pizzaStore2 = new ChicagoPizzaStore(); var pizza2 = pizzaStore2.OrderPizza("cheese"); Console.WriteLine("Name: " + pizza2.Name + " Dough: " + pizza2.Dough + " Sauce" + pizza2.Sauce); }
public static void Run() { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine("Ethan ordered a " + pizza.name + "\n"); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine("Joel ordered a " + pizza.name + "\n"); }
public void Test() { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine($"Ethan orderd a {pizza.Name} {Environment.NewLine}"); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine($"Joel orderd a {pizza.Name} {Environment.NewLine}"); }
static void Main(string[] args) { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoPizzaStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine("First pizza {0}", pizza.GetName()); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine("Second pizza {0}", pizza.GetName()); Console.ReadKey(); }
static void Main(string[] args) { PizzaStore store = new NYPizzaStore(); store.OrderPizza(PizzaType.Cheese); Console.WriteLine("\n"); store = new ChicagoPizzaStore(); store.OrderPizza(PizzaType.Sausage); Console.ReadKey(); }
public static void CreatePizzaTestDrive() { PizzaStore nyStore = new NYPizzaStore(); PizzaStore chicagoStore = new ChicagoStore(); Pizza pizza = nyStore.OrderPizza("cheese"); Console.WriteLine($"Ethan ordered a {pizza.Name}"); Console.WriteLine(); pizza = chicagoStore.OrderPizza("cheese"); Console.WriteLine($"Joel ordered a {pizza.Name}"); }
static void Main(string[] args) { PizzaStore pizzaStore; pizzaStore = new NYPizzaStore(); pizzaStore.OrderPizza(PizzaType.Pepperoni); Console.WriteLine("\n"); pizzaStore = new ChicagoPizzaStore(); pizzaStore.OrderPizza(PizzaType.Cheese); Console.ReadKey(); }