public RestaurantController()
 {
     _restaurantFacade   = new RestaurantFacade();
     _bookingFacade      = new BookingFacade();
     _imageFacade        = new ImageFacade();
     _menuItemTypeFacade = new MenuItemTypeFacade();
 }
示例#2
0
        public void GetNonVegPizza_ShouldReturn_GettingNonVegPizza()
        {
            var    facadeForClient = new RestaurantFacade();
            String str             = facadeForClient.GetNonVegPizza();

            Assert.Equal("Getting Non Veg Pizza.", str);
        }
示例#3
0
 public void Test_GetVegPizza()
 {
     Console.WriteLine("123");
     RestaurantFacade facade = new RestaurantFacade();
     string a = facade.GetVegPizza();
     Assert.AreEqual("Getting Veg Pizza.", a);
 }
示例#4
0
        public void TestFacede1()
        {
            RestaurantFacade facade = new RestaurantFacade();
            string           b      = facade.GetCheesyGarlicBread();

            Assert.Equal("Getting Garlic Bread....", b);
        }
示例#5
0
 public RestaurantAdminController()
 {
     _restaurantFacade = new RestaurantFacade();
     _companyFacade    = new CompanyFacade();
     _menuFacade       = new MenuFacade();
     _tableFacade      = new TableFacade();
     _imageFacade      = new ImageFacade();
 }
示例#6
0
        static void Main(string[] args)
        {
            var facadeForClient = new RestaurantFacade();

            facadeForClient.GetNonVegPizza();
            facadeForClient.GetVegPizza();
            facadeForClient.GetGarlicBread();
            facadeForClient.GetCheesyGarlicBread();
            Console.ReadLine();
        }
示例#7
0
        static void Main(string[] args)
        {
            Console.WriteLine("----------------------CLIENT ORDERS FOR PIZZA----------------------------\n");
            var facadeForClient = new RestaurantFacade();

            facadeForClient.GetNonVegPizza();
            facadeForClient.GetVegPizza();
            Console.WriteLine("\n----------------------CLIENT ORDERS FOR BREAD----------------------------\n");
            facadeForClient.GetGarlicBread();
            facadeForClient.GetCheesyGarlicBread();
        }
示例#8
0
        public void TestFacade()
        {
            RestaurantFacade facade = new RestaurantFacade();
            string           a      = facade.GetVegPizza();

            //string b = facade.GetCheesyGarlicBread();
            //string c = facade.GetGarlicBread();
            Assert.Equal("Getting Veg Pizza.", a);
            //Assert.Equal("Getting Garlic Bread.", b);
            //Assert.Equal("Getting Cheesy Garlic Bread.", c);
        }
        public ActionResult FacadeSDP()
        {
            List <string> objRestaurantItems = new List <string>();

            var facadeForClient = new RestaurantFacade();

            objRestaurantItems.Add(facadeForClient.GetNonVegPizza());
            objRestaurantItems.Add(facadeForClient.GetVegPizza());
            objRestaurantItems.Add(facadeForClient.GetGarlicBread());
            objRestaurantItems.Add(facadeForClient.GetCheesyGarlicBread());
            return(View());
        }
示例#10
0
        public void Run()
        {
            var pizzaFactory = new PizzaFactory(_pizzaBuildState, _orderConstructor);
            var margarita    = pizzaFactory.MakePizza(Enum_Menu.Pepperoni, Enum_PizzaType.GlutenFree);


            var order = new NormalOrder(5, new Pizza {
                Price = 12
            });
            var makeOrder     = order.MakeOrder();
            var calculateCost = order.CalculateCost();

            var removePizzaFromOrder          = new RemovePizzaFromOrder(order, 2);
            var updateOrderAfterRemovePizza   = removePizzaFromOrder.UpdateOrder();
            var calculateCostAfterRemovePizza = removePizzaFromOrder.CalculateCost();

            var addPizzaToOrder = new AddPizzaToOrder(removePizzaFromOrder, 7, new Pizza {
                Price = 22
            });
            var updateOrdeAfterAddPizzaToOrder    = addPizzaToOrder.UpdateOrder();
            var calculateCostAfterAddPizzaToOrder = addPizzaToOrder.CalculateCost();


            var custom      = pizzaFactory.MakePizza(Enum_Menu.CustomPizza, Enum_PizzaType.GlutenFree);
            var customPizza = new CustomPizzaFluentBuilder(custom)
                              .AddDough("Custom Dough")
                              .AddSauce("Custom Sauce")
                              .SetCheese("Custom Cheese")
                              .Build();


            int pizzaCount = 3;
            var pizzaList  = _clone.GetPizzaCloneList(margarita.Clone(), pizzaCount);

            var restaurantFacade = new RestaurantFacade();

            restaurantFacade.GetOrder(Enum_OrderType.Drinks);

            var traineeServer = new TraineeServer(new Server());

            traineeServer.MakeOrder(new Pizza {
                Count = 3
            });

            var mediator          = new OrderMediator();
            var pizzaType         = Enum_Menu.Pepperoni;
            var pizza             = Enum_PizzaType.Normal;
            var webPage           = new WebPage(mediator);
            var restaurantService = new RestaurantService(mediator, pizzaType, pizza, _pizzaBuildState, _orderConstructor);

            mediator.Restaurant = restaurantService;
            mediator.WebPage    = webPage;

            var orderManager        = new OrderManager();
            var orderManagerAdapter = new OrderMenagerAdapter(orderManager);
            var orderFromAdapter    = orderManagerAdapter.OrderManager;


            PizzaProcessLogger.LogsList.Clear();
            var   log   = PizzaProcessLogger.LogsList;
            Build build = new Build(string.Empty);
            PizzaBuilderManager pizzaBuilderManager = new PizzaBuilderManager(build);
            Action saveCurrentBuild = () => pizzaBuilderManager.SaveCurrentBuild();

            webPage.Send($"Poproszę pizze: {pizzaType.ToString()}");
            restaurantService.Send("Zamówienie zostało przekazane");
            webPage.Send("Czy mogę zobaczyc proces tworzenia pizzy");
            restaurantService.Send("Tak, proszę bardzo");
            for (int i = 0; i < PizzaProcessLogger.LogsList.Count; i++)
            {
                build.SetState(log[i]);
                pizzaBuilderManager.SaveCurrentBuild();
                saveCurrentBuild.Invoke();
                Console.WriteLine(log[i]);
            }
            webPage.Send("Chciałbym pizze bez ostatniego składnika, czy to możliwe?");
            restaurantService.Send("Tak, oczywiście! bardzo proszę");
            pizzaBuilderManager.Undo(pizzaType.ToString());
            webPage.Send("Dziękuję");
        }
 public HomeController()
 {
     ViewBag.Admin     = true;
     _companyFacade    = new CompanyFacade();
     _restaurantFacade = new RestaurantFacade();
 }