public void Order_OrderMorningMultipleDrinks_ReturnDrinkWithMultiplicitySignal()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("morning,1,2,3,3,3");

            Assert.AreEqual(orderResult, "eggs, toast, coffee(x3)");
        }
        public void Order_OrderMorningNotApplicableDish_ShowErrorMessageAfterValidMessages()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("morning,1,2,3,4");

            Assert.AreEqual(orderResult, "eggs, toast, coffee, error");
        }
        public void Order_OrderMorning231_ShowseggsToastCoffeeSucessfully()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("morning,1,2,3");

            Assert.AreEqual(orderResult, "eggs, toast, coffee");
        }
        public void Order_OrderMorning1223_StopAfterEgg()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("morning,1,2,2,3");

            Assert.AreEqual(orderResult, "eggs, error");
        }
        public void Order_NightUpperCase_ShowMultipleSides()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("NIGHT,1,2,2,4");

            Assert.AreEqual(orderResult, "steak, potato(x2), cake");
        }
        public void Order_InputInvalidTimeOfDay_ShowErrorWord()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("afternoon,1,2,2,2,3,3,3,4");

            Assert.AreEqual(orderResult, "error");
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            string input = "";

            Console.WriteLine("To quit, press q.");
            IMenu menu = new MenuFactory().Create();

            while (true)
            {
                Console.Write("Please, input your order: ");
                input = Console.ReadLine();

                if (input.ToLower() == "q")
                {
                    break;
                }

                Ordering ordering = new Ordering(menu);
                string resultMessage = ordering.Order(input);
                Console.WriteLine("Output: " + resultMessage);
            }
        }
        public void Order_OrderNight1234_ShowSteakPotatoWineCake()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("night,1,2,3,4");

            Assert.AreEqual(orderResult, "steak, potato, wine, cake");
        }
        public void Order_OrderNightInvalidDishRepetition_ShowMultipleErros()
        {
            Ordering ordering = new Ordering(new MenuFactory().Create());
            string orderResult = ordering.Order("night,1,2,2,2,3,3,3,4");

            Assert.AreEqual(orderResult, "steak, potato(x3), error");
        }