private void Test_HawaianPizzaExists() { // arrange Size size = new Size("Small"); string crust = "Garlic"; HawaianPizza hawaianpizza = new HawaianPizza(size, crust); Assert.Equal(size, hawaianpizza.Size); Assert.Equal(crust, hawaianpizza.Crust); }
public List <APizza> PizzaSeeding() { APizza meat = new MeatPizza(); meat.Crust = new Crust( ) { Name = "thin", Price = 2.50M }; meat.Size = new Size() { Name = "small", Price = 5.00M }; meat.Toppings = new List <Topping>() { new Topping("beef meat", 1.00M), new Topping("cheese", 1.00M) }; APizza vegan = new VeganPizza(); vegan.Crust = new Crust() { Name = "rising", Price = 3.50M }; vegan.Size = new Size() { Name = "small", Price = 5.00M }; vegan.Toppings = new List <Topping> { new Topping("broccoli", 1.00M), new Topping("cheese", 1.00M) }; APizza hawaian = new HawaianPizza(); meat.Crust = new Crust( ) { Name = "thin", Price = 2.50M }; meat.Size = new Size() { Name = "small", Price = 5.00M }; meat.Toppings = new List <Topping>() { new Topping("Ham", 1.00M), new Topping("Pineapple", 0.25M), new Topping("Cheese", 0.50M) }; List <APizza> pizzaList = new List <APizza>(); pizzaList.Add(meat); pizzaList.Add(vegan); pizzaList.Add(hawaian); FileStorage bat = new FileStorage(); //this is the file where the XML will store the pizza files bat.WritePizzaToXml(pizzaList); return(bat.ReadPizzaFromXml <APizza> ().ToList()); /* SINGLETON METHOD WORKFLOW */ // public static StoreSingleton GetInstance() // { // if (_storeSingleton == null) // { // _storeSingleton = new StoreSingleton(); // printer // } // return _storeSingleton; // } }
public static void PizzaSeeding() //method { APizza meat = new MeatPizza(); meat.Crust = new Crust( ) { Name = "thin", Price = 2.50M }; meat.Size = new Size() { Name = "small", Price = 5.00M }; meat.Toppings = new List <Topping>() { new Topping("beef meat", 1.00M), new Topping("cheese", 1.00M) }; APizza vegan = new VeganPizza(); vegan.Crust = new Crust() { Name = "rising", Price = 3.50M }; vegan.Size = new Size() { Name = "small", Price = 5.00M }; vegan.Toppings = new List <Topping> { new Topping("broccoli", 1.00M), new Topping("cheese", 1.00M) }; APizza hawaian = new HawaianPizza(); hawaian.Crust = new Crust( ) { Name = "thin", Price = 2.50M }; hawaian.Size = new Size() { Name = "small", Price = 5.00M }; hawaian.Toppings = new List <Topping>() { new Topping("Ham", 1.00M), new Topping("Pineapple", 0.25M), new Topping("Cheese", 0.50M) }; List <APizza> d = new List <APizza>(); d.Add(meat); d.Add(hawaian); d.Add(vegan); var dCount = 1; foreach (var display in d) // displaying the pizzas for the customer to chose { System.Console.WriteLine(dCount + ") " + display.Name); dCount++; } System.Console.WriteLine("Please a chose a number: "); var pizzaNum = System.Console.ReadLine(); }