private void AddOutings() { KomodoOutings newoutings = new KomodoOutings(); Console.WriteLine("Please enter the Event Type:"); newoutings.EventType = Console.ReadLine(); Console.WriteLine("Please enter the number of people attending:"); string numberOfPeopleString = Console.ReadLine(); newoutings.NumberOfPeople = int.Parse(numberOfPeopleString); Console.WriteLine("Please enter the Date of the outing (EXAMPLE: April, 3 2021):"); newoutings.DateOfEvent = Console.ReadLine(); Console.WriteLine("Please enter the cost per person for this event:"); string costPerPersonString = Console.ReadLine(); newoutings.CostPerPerson = int.Parse(costPerPersonString); Console.WriteLine("Please enter the total cost for this event:"); string eventTotalCost = Console.ReadLine(); newoutings.EventTotalCost = int.Parse(eventTotalCost); _contentRepo.AddOutingsToList(newoutings); }
private void AddAnOuting() { Console.WriteLine("What is the outing type number?\n" + "1: Golf\n" + "2: Bowling\n" + "3: AmusementPark\n" + "4: Concert"); int outing = int.Parse(Console.ReadLine()); EventType eventType = (EventType)outing; Console.WriteLine("What number of people attended?"); int peopleCount = int.Parse(Console.ReadLine()); Console.WriteLine("What is the date of the outing? (YYYY/MM/DD)"); DateTime outingDateTime = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Type is the cost per person in decimal form? (5.50)"); decimal peoplePrice = decimal.Parse(Console.ReadLine()); Console.WriteLine("What is the cost for the outing? (200.65)"); decimal outingPrice = decimal.Parse(Console.ReadLine()); KomodoOutings newOuting = new KomodoOutings(eventType, peopleCount, outingDateTime, peoplePrice, outingPrice); _outingRepo.EventCost(newOuting); _outingRepo.AddToEventList(newOuting); }
public void TestTotalEventCost() { KomodoOutingRepository repoInfo = new KomodoOutingRepository(); KomodoOutings productInfo = new KomodoOutings(EventType.Bowling, 6, new DateTime(2019 / 1 / 25), 25.50m, 220m); repoInfo.AddToEventList(productInfo); var actual = repoInfo.AllEventCostList(); var expected = 373m; Assert.AreEqual(expected, actual); }
public void AddAndGetList() { KomodoOutingRepository repoInfo = new KomodoOutingRepository(); KomodoOutings productInfo = new KomodoOutings(EventType.Bowling, 5, new DateTime(2019 / 1 / 25), 15.23m, 250.50m); repoInfo.AddToEventList(productInfo); List <KomodoOutings> list = repoInfo.GetEventList(); var expected = 1; var actual = list.Count; Assert.AreEqual(expected, actual); }
private void SeedMenu() { double golfcost = 6000; String.Format("{0:#,##0.##}", 6000); KomodoOutings golf = new KomodoOutings("Golf", 300, "April 1st 2021", 20, golfcost); KomodoOutings bowling = new KomodoOutings("Bowling", 200, "April 2nd, 2021", 10, 2000); KomodoOutings amusementPark = new KomodoOutings("Amusement Park", 400, "April 4th, 2021", 30, 12000); KomodoOutings concert = new KomodoOutings("Concert", 100, "April 3rd, 2021", 50, 5000); _contentRepo.AddOutingsToList(golf); _contentRepo.AddOutingsToList(bowling); _contentRepo.AddOutingsToList(amusementPark); _contentRepo.AddOutingsToList(concert); }
public void SpecificTypeAllCost() { KomodoOutingRepository repoInfo = new KomodoOutingRepository(); KomodoOutings productInfo = new KomodoOutings(EventType.Bowling, 6, new DateTime(2019 / 1 / 25), 25.50m, 220m); KomodoOutings productInfo2 = new KomodoOutings(EventType.Bowling, 6, new DateTime(2019 / 1 / 25), 25.50m, 220m); repoInfo.EventCost(productInfo); repoInfo.EventCost(productInfo2); repoInfo.AddToEventList(productInfo); repoInfo.AddToEventList(productInfo2); repoInfo.SpecificEventCost(EventType.Bowling); var actual = repoInfo.AllEventCostList(); var expected = 746m; Assert.AreEqual(expected, actual); }