public void Morning_All_Foods()
        {
            var entry     = "morning,1,2,3";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "eggs, toast, coffee");
        }
        public void Morning_Four_Times_Coffee()
        {
            var entry     = "morning,3,3,3,3";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "coffee(x4)");
        }
        public void Morning_None_Input()
        {
            var entry     = "morning";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput.Count() == 0);
        }
        public void Morning_Only_Eggs_And_Toast()
        {
            var entry     = "morning,1,2";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "eggs, toast");
        }
        public void Morning_Invalid_Input()
        {
            var entry     = "morning,5";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "error");
        }
        public void Morning_Repeat_Three_Times_Coffee()
        {
            var entry     = "morning,1,2,3,3,3";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "eggs, toast, coffee(x3)");
        }
        public void Night_Four_Times_Potato()
        {
            var entry     = "night,2,2,2,2";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "potato(x4)");
        }
        public void Morning_Dessert_Not_Applicable()
        {
            var entry     = "morning,4";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "error");
        }
        public void Night_All_Foods()
        {
            var entry     = "night,1,2,3,4";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "steak, potato, wine, cake");
        }
        public void Night_Only_Steak_And_Potato()
        {
            var entry     = "night,1,2";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "steak, potato");
        }
        public void Night_Repeat_Three_Times_Potato()
        {
            var entry     = "night,1,2,2,2,3";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "steak, potato(x3), wine");
        }
        public void Night_Have_Dessert()
        {
            var entry     = "night,4";
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            dish.OutputResult();
            var formatOutput = string.Join(", ", dish.result.ToArray());

            Assert.True(formatOutput == "cake");
        }
Esempio n. 13
0
        public static void Execute(string entry)
        {
            var orderDish = new MakeDish(entry);

            var dish = orderDish.GetDish();

            if (dish == null)
            {
                System.Console.WriteLine("invalid period.");
            }
            else
            {
                dish.OutputResult();
            }
        }