// #1 New Input private void NewEntry() { Console.Clear(); CafeLibrary newData = new CafeLibrary(); //MealNumber Console.WriteLine("Enter Number"); string numberAsString = Console.ReadLine(); int numberAsInt = int.Parse(numberAsString); newData.MealNumber = numberAsInt; //MealName Console.WriteLine("Meal Name"); newData.MealName = Console.ReadLine(); //Description Console.WriteLine("Brief Description"); newData.Description = Console.ReadLine(); //Ingredients Console.WriteLine("Top Five Ingredients"); newData.Ingredients = Console.ReadLine(); //Price Console.WriteLine("Meal Price $00.00"); string priceAsString = Console.ReadLine(); newData.Price = double.Parse(priceAsString); _dataRepo.AddDatatoMenu(newData); }
public void Arrange() { _repo = new CafeRepo(); _data = new CafeLibrary(1, "BLT", "Bacon Lettuce and Tomato Sandwich", "Pork Bacon Lettuce, Tomato, Mayo and Rye Bread", 4.99); _repo.AddDatatoMenu(_data); }
// SEED METHOD private void ExampleData() { CafeLibrary BLT = new CafeLibrary(1, "BLT", "Bacon Lettuce and Tomato Sandwich", "Pork Bacon Lettuce, Tomato, Mayo and Rye Bread", 4.99); CafeLibrary Hamburger = new CafeLibrary(2, "Hamburger", "Angus Beef with American Cheese on a WHole Wheat Bun", "Beef, American Cheese, Lettuce, Onion, Tomato and Wheat Bread", 5.99); CafeLibrary Reuben = new CafeLibrary(3, "Reuben Sandwich", "Grilled Corn Beef Sandwich serviced with a dill Pickel", "Corn Beef, Swiss Cheese,Sauerkraut and Russian Dressing", 8.99); _dataRepo.AddDatatoMenu(BLT); _dataRepo.AddDatatoMenu(Hamburger); _dataRepo.AddDatatoMenu(Reuben); }
public void AddToListNull() { // Arrange CafeLibrary data = new CafeLibrary(); data.MealNumber = 1; CafeRepo repository = new CafeRepo(); // Act repository.AddDatatoMenu(data); CafeLibrary dataFromDir = repository.GetDataWithMealNumber(1); // Assert Assert.IsNotNull(dataFromDir); }
// #3 Delete Data private void DisplaybyMealNumber() { Console.Clear(); Console.WriteLine("Enter meal number to remove"); string mealNumber = Console.ReadLine(); int result = Convert.ToInt32(mealNumber); CafeLibrary data = _dataRepo.GetDataWithMealNumber(result); if (data != null) { Console.WriteLine($"Title: {data.MealName},\n" + $"Description: {data.Description},\n" + $"Ingredients: {data.Ingredients},\n" + $"Price: {data.Price}"); } else { Console.WriteLine("That Item is Not Available. Please Make Another Selection "); } }