Ejemplo n.º 1
0
        public void TestDishInputParser_Invalid_TimeOfTheDay()
        {
            string inputString     = "errrrr,1,2,3";
            var    dishInputParser = new DishInputParser(inputString);
            var    validateResult  = dishInputParser.Validate();

            Assert.IsTrue(validateResult);

            dishInputParser.Process();
            Assert.IsTrue(dishInputParser.OrderNumbers.Count == 3);
        }
Ejemplo n.º 2
0
        public void TestDishInputParser_ValidInputString_WithTimeOfTheDay_Night()
        {
            string inputString     = "night,1,2,3";
            var    dishInputParser = new DishInputParser(inputString);
            var    validateResult  = dishInputParser.Validate();

            Assert.IsTrue(validateResult);

            dishInputParser.Process();
            Assert.IsTrue(dishInputParser.OrderNumbers.Count == 3);
        }
        public void TestDishInputParser_ValidInputString_WithTimeOfTheDay_Morning()
        {
            string inputString     = "morning,1,2,3";
            var    dishInputParser = new DishInputParser(inputString);
            var    validateResult  = dishInputParser.Validate();

            dishInputParser.Process();

            var dishOrderProcessor = new DishOrderProcessor(dishInputParser);
            var output             = dishOrderProcessor.ProcessDishOrder();

            Assert.AreEqual(output, "eggs,toast,coffee");
        }