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); } } }
public void WhenInputsAreValidsThenRerturnTheSameNumberOfInputs() { var inputModel = new ShopInputModel("morning,1,2,3"); Assert.AreEqual(3, inputModel.Entries.Length); }
public void WhenInputsAreInvalidsThenThrowException() { var inputModel = new ShopInputModel("morning,egg,lunch"); }
public void WhenInputIsValidTimeOfDayThenReturnNight() { var inputModel = new ShopInputModel("night"); Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Night)); }
public void WhenInputIsValidMorningThenReturnMorning() { var inputModel = new ShopInputModel("morning"); Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Morning)); }
public void WhenInputIsValidCaseInsensitiveNightThenReturnMorning() { var inputModel = new ShopInputModel("NiGhT"); Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Night)); }
public void WhenInputIsValidCaseInsensitiveMorningThenReturnMorning() { var inputModel = new ShopInputModel("MoRnInG"); Assert.IsInstanceOfType(inputModel.TimeOfDay, typeof(Morning)); }
public void WhenInputIsInvalidTimeOfDayThenThrowException() { var inputModel = new ShopInputModel("lunch"); }