예제 #1
0
 public void MakeMeatPizza()
 {
     //requirement: An order can only have 50 pizza's
     if (ValidateUnderPizzaLimit())
     {
         Pizzas.Add(_pizzaFactory.Make <MeatPizza>());
     }
     ValidateUnderPriceLimit();
 }
예제 #2
0
        public void MakeAPizzaMeat(AItemModel C, AItemModel S, List <Toppings> T)
        {
            Pizzas.Add(_pizzaFactory.Make <PizzaMeat>());
            Pizzas.Last().Crust         = (Crust)C;
            Pizzas.Last().Size          = (Size)S;
            Pizzas.Last().PizzaToppings = T;
            var tp = T.Sum(x => x.ItemPrice);

            Pizzas.Last().CalculatePrice(tp);
        }
예제 #3
0
        public void TestMeatPizzaExists()
        {
            // create
            var MeatTest = PizzaFactory.Make <MeatPizza>();

            // act
            var Actual = MeatTest;

            // assert
            Assert.IsType <MeatPizza>(Actual);
            Assert.NotNull(Actual);
        }
예제 #4
0
        public Pizza Pizza(string userName, string type, string crust, string size, float price)
        {
            Pizza pizza = _pizzaFactory.Make <Pizza>();

            pizza.Name      = type;
            pizza.Crust     = crust;
            pizza.Size      = size;
            pizza.Price     = price;
            pizza.OrderName = userName;
            return(pizza);
        }
예제 #5
0
        private void Test_PizzaFactory_Works()
        {
            // arrange
            var sut = new GenericPizzaFactory();

            // act
            var actual = sut.Make <VeggiePizza>();

            // assert
            Assert.IsType <VeggiePizza>(actual);
            Assert.NotNull(actual);
        }
예제 #6
0
파일: Order.cs 프로젝트: chegior/project-p0
 public void MakeMeatPizza()
 {
     Pizzas.Add(_pizzaFactory.Make <MeatPizza>());
 }
예제 #7
0
 public void MakePizza()
 {
     Pizzas.Add(pizzaFactory.Make <Pizza>());
 }
예제 #8
0
        public void AddPizza()
        {
            var choice = (SelectPizza());

            if (choice == 1)
            {
                // check to see if amount of pizza is less than 50
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <PepperoniPizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Pepperoni Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 2)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <FourCheesePizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Four Cheese Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 3)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <VeggiePizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Veggie Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 4)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <MeatPizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Meat Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 5)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <MeatPizza>();
                    p.OrderId = EntityId;
                    p.Size    = "Large";
                    Pizzas.Add(p);
                    System.Console.WriteLine("Meat Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 6)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <PepperoniPizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Pepperoni Pizza Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 7)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <FourCheesePizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Four Cheese Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 8)
            {
                if (Pizzas.Count < 25)
                {
                    APizzaModel p = _pizzaFactory.Make <VeggiePizza>();
                    p.OrderId = EntityId;
                    Pizzas.Add(p);
                    System.Console.WriteLine("Veggie Added to Order");
                    AddPizza();
                    Total = Total + 10;
                }
                else
                {
                    Console.WriteLine("Max Order amount reached");
                }
            }
            else if (choice == 0)
            {
                System.Console.WriteLine("Finished Ordering..");
            }
            else
            {
                System.Console.WriteLine("Choose a valid option");
                AddPizza();
            }
        }
예제 #9
0
파일: Order.cs 프로젝트: lcatz/project-p0
 public void MakeMeatPizza()
 {
     Pizzas.Add(_pizzaFactory.Make <MeatPizza>());
     OrderPrice += 30.00M;
 }
예제 #10
0
 public void MakeMeatPizza(List <Crust> availCrusts, List <Size> availSizes, List <Topping> availToppings)
 {
     Pizzas.Add(_pizzaFactory.Make <MeatPizza>());
     AddMajorPizzaParts(Pizzas.Last(), availCrusts, availSizes, availToppings);
 }
예제 #11
0
 public void MakeMeatPizza(Size size, string crust)
 {
     Pizzas.Add(_pizzaFactory.Make <MeatPizza>(size, crust));
 }