Beispiel #1
0
        static void Main(string[] args)
        {
            while (true)
            {
                try
                {
                    var entry = Console.ReadLine().ToLower();

                    var shopInput = new ShopInputModel(entry);

                    var shop = new Shop(shopInput.TimeOfDay);

                    var dishes = shop.GetDishes(shopInput.Entries);

                    shopInput.Display(dishes);
                }
                catch (ShopException ex)
                {
                    Console.WriteLine(ex.Message);
                }

            }
        }
Beispiel #2
0
 public void WhenInputsAreValidsThenRerturnTheSameNumberOfInputs()
 {
     var inputModel = new ShopInputModel("morning,1,2,3");
     Assert.AreEqual(3, inputModel.Entries.Length);
 }
Beispiel #3
0
 public void WhenInputsAreInvalidsThenThrowException()
 {
     var inputModel = new ShopInputModel("morning,egg,lunch");
 }
Beispiel #4
0
 public void WhenInputIsValidTimeOfDayThenReturnNight()
 {
     var inputModel = new ShopInputModel("night");
     Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Night));
 }
Beispiel #5
0
 public void WhenInputIsValidMorningThenReturnMorning()
 {
     var inputModel = new ShopInputModel("morning");
     Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Morning));
 }
Beispiel #6
0
 public void WhenInputIsValidCaseInsensitiveNightThenReturnMorning()
 {
     var inputModel = new ShopInputModel("NiGhT");
     Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Night));
 }
Beispiel #7
0
 public void WhenInputIsValidCaseInsensitiveMorningThenReturnMorning()
 {
     var inputModel = new ShopInputModel("MoRnInG");
     Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Morning));
 }
Beispiel #8
0
 public void WhenInputIsInvalidTimeOfDayThenThrowException()
 {
     var inputModel = new ShopInputModel("lunch");
 }