private void AddToList() { Console.Clear(); OutingContent newOuting = new OutingContent(); Console.WriteLine("Please enter the number of people attending:"); string intAsString = Console.ReadLine(); int peopleNum = int.Parse(intAsString); newOuting.NumberOfPeople = peopleNum; Console.WriteLine("Please enter the cost per person:"); string personString = Console.ReadLine(); decimal personDec = decimal.Parse(personString); newOuting.CostPerPerson = personDec; Console.WriteLine("Please enter the date of the event:"); string dateAsString = Console.ReadLine(); DateTime actualDate = DateTime.Parse(dateAsString); newOuting.Date = actualDate; Console.WriteLine("Please enter the number for the type of event:\n " + "1 = Golf\n 2 = Amusement Park\n 3 = Concert"); string typeAsString = Console.ReadLine(); int eventType = int.Parse(typeAsString); newOuting.TypeOfEvent = (EventType)eventType; _outingRepo.CreateOuting(newOuting); }
private void AddOuting() { OutingContent newOuting = new OutingContent(); Console.Clear(); Console.WriteLine("Enter Event Type:\n" + "1. Amusement Park\n" + "2. Bowling\n" + "3. Concert\n" + "4. Golf"); string typeAsString = Console.ReadLine(); int typeAsInt = int.Parse(typeAsString); newOuting.EventType = (Events)typeAsInt; Console.WriteLine("How many people attended the event? (enter number)"); newOuting.AttendanceNumber = int.Parse(Console.ReadLine()); Console.WriteLine("Enter date of event: (ex. 01/01/2020"); newOuting.DateOfEvent = DateTime.Parse(Console.ReadLine()); Console.WriteLine("What is the cost per person? ex. 99.99"); newOuting.CostPerPerson = double.Parse(Console.ReadLine()); _repo.AddNewOuting(newOuting); }
public void AddOutingToList() { Console.WriteLine("Enter Outing Type: \n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert\n"); string typeAsString = Console.ReadLine(); int TypeAsInt = int.Parse(typeAsString); OutingType type = (OutingType)TypeAsInt; Console.WriteLine("Enter the Amount of People who Attended: "); string attendedAsString = Console.ReadLine(); int peopleAttended = int.Parse(attendedAsString); Console.WriteLine("Enter Date of Outing: (Example: 9/1/2001) "); string dateString = Console.ReadLine(); DateTime date = DateTime.Parse(dateString); Console.WriteLine("Enter Cost Per Person: "); string costPerPersonString = Console.ReadLine(); decimal costPerPerson = decimal.Parse(costPerPersonString); //Console.WriteLine("Enter Cost of Event: "); //string costForEventString = Console.ReadLine(); //decimal costForEvent = decimal.Parse(costForEventString); OutingContent content = new OutingContent(type, peopleAttended, date, costPerPerson); _outingRepo.AddToList(content); }
private void SeedOutingList() { OutingContent outingOne = new OutingContent(EventType.Bowling, 20, new DateTime(2020, 8, 8), 20.00m); OutingContent outingTwo = new OutingContent(EventType.AmusementPark, 50, new DateTime(2020, 10, 1), 50.00m); OutingContent outingThree = new OutingContent(EventType.Concert, 30, new DateTime(2020, 7, 15), 30.00m); _outingRepo.AddOuting(outingOne); _outingRepo.AddOuting(outingTwo); _outingRepo.AddOuting(outingThree); }
private void SeedMethod() { OutingContent topGolf = new OutingContent(3, 15.99m, new DateTime(3 / 10 / 2020), (EventType.Golf)); OutingContent circleGolf = new OutingContent(4, 16.99m, new DateTime(4 / 20 / 2020), (EventType.Golf)); OutingContent sixFlags = new OutingContent(5, 25.99m, new DateTime(7 / 10 / 2020), (EventType.AmusementPark)); OutingContent lupeFiasco = new OutingContent(7, 35.99m, new DateTime(11 / 10 / 2020), (EventType.Concert)); _outingRepo.CreateOuting(sixFlags); _outingRepo.CreateOuting(lupeFiasco); _outingRepo.CreateOuting(topGolf); _outingRepo.CreateOuting(circleGolf); }
public void AddOutingTest() { //Arrange OutingContent outingFour = new OutingContent(EventType.Golf, 10, new DateTime(2020, 8, 20), 45.00m); //Act outingTest.AddOuting(outingFour); int actual = outingTest.GetOutingList().Count; //Assert Assert.AreEqual(4, actual); }
public void DefaultOuting() { OutingContent torres = new OutingContent(OutingContent.Events.Amusement_Park, 150, new DateTime(2020, 06, 04), 25); OutingContent owen = new OutingContent(OutingContent.Events.Bowling, 50, new DateTime(2020, 10, 31), 15); OutingContent ruudberg = new OutingContent(OutingContent.Events.Concert, 450, new DateTime(2020, 07, 26), 45); OutingContent litzsey = new OutingContent(OutingContent.Events.Golf, 16, new DateTime(2020, 09, 14), 65); _repo.AddNewOuting(torres); _repo.AddNewOuting(owen); _repo.AddNewOuting(ruudberg); _repo.AddNewOuting(litzsey); }
public void Arrange() { _outingRepo = new OutingContentRepository(); _content = _outingRepo.GetOutingContentList(); OutingContent outing = new OutingContent(65, DateTime.Parse("2019/06/15"), OutingType.Golf, 75m, 300m); OutingContent outingTwo = new OutingContent(45, DateTime.Parse("2019/04/22"), OutingType.Bowling, 40m, 400m); OutingContent outingThree = new OutingContent(40, DateTime.Parse("2019/07/25"), OutingType.AmusementPark, 50m, 500m); _outingRepo.AddOutingContentToList(outing); _outingRepo.AddOutingContentToList(outingTwo); _outingRepo.AddOutingContentToList(outingThree); }
public void GetOutingCostByType() { Arrange(); OutingContentRepository outingRepo = new OutingContentRepository(); OutingContent cost = new OutingContent(50, DateTime.Parse("2019, 08, 23"), OutingType.Concert, 80m, 600m); outingRepo.AddOutingContentToList(cost); decimal actual = outingRepo.GetOutingCostByType(OutingType.Concert); Assert.AreEqual(cost.TotalCostOfOutings, actual); }
public void AddToListTest() { OutingRepo outingRepo = new OutingRepo(); List <OutingContent> outingList = outingRepo.GetOutingList(); OutingContent content = new OutingContent(OutingType.Concert, 10, DateTime.Today, 10m); int expected = 1; outingRepo.AddToList(content); Assert.AreEqual(expected, outingList.Count); }
//update public bool UpdateOuting(DateTime oldDate, OutingContent newInfo) { OutingContent oldOuting = GetOutingByDate(oldDate); if (oldOuting != null) { oldOuting.CostPerPerson = newInfo.CostPerPerson; oldOuting.Date = newInfo.Date; oldOuting.NumberOfPeople = newInfo.NumberOfPeople; oldOuting.TypeOfEvent = newInfo.TypeOfEvent; return(true); } else { return(false); } }
public void CombineCostAllTest() { OutingRepo outingRepo = new OutingRepo(); OutingContent content = new OutingContent(); content.CostForEvent = 100m; OutingContent contentOne = new OutingContent(); contentOne.CostForEvent = 100m; outingRepo.AddToList(content); outingRepo.AddToList(contentOne); decimal expected = 200m; decimal actual = outingRepo.CombinedCostOfAllOutingsGet(); Assert.AreEqual(expected, actual); }
public void CombinedCostAmusementParkTest() { OutingRepo outingRepo = new OutingRepo(); OutingContent content = new OutingContent(); content.CostForEvent = 100m; content.Type = OutingType.AmusementPark; OutingContent contentOne = new OutingContent(); contentOne.CostForEvent = 100m; contentOne.Type = OutingType.AmusementPark; outingRepo.AddToList(content); outingRepo.AddToList(contentOne); decimal expected = 200m; decimal actual = outingRepo.CombinedTypeCostAmusementParks(); Assert.AreEqual(expected, actual); }
public void ObjectTest() { OutingContent contentOne = new OutingContent(); contentOne.CostForEvent = 100m; decimal expected = 100m; Assert.AreEqual(expected, contentOne.CostForEvent); OutingContent content = new OutingContent(OutingType.Concert, 10, DateTime.Today, 10m); OutingType expectedType = OutingType.Concert; int expectedAttended = 10; DateTime expectedTime = DateTime.Today; decimal expectedCostPerPerson = 10m; decimal expectedCostForEvent = 100m; Assert.AreEqual(expectedType, content.Type); Assert.AreEqual(expectedAttended, content.PeopleAttended); Assert.AreEqual(expectedTime, content.Date); Assert.AreEqual(expectedCostPerPerson, content.CostPerPerson); Assert.AreEqual(expectedCostForEvent, content.CostForEvent); }
//create public void CreateOuting(OutingContent outing) { _outingList.Add(outing); }
private void AddOuting() { Console.Clear(); OutingContent newOuting = new OutingContent(); Console.WriteLine("What is the type of the event: Golf, Bowling, Amusement Park, Concert"); string choice = Console.ReadLine(); if (choice.ToLower() == "golf") { EventType eventType = EventType.Golf; } else if (choice.ToLower() == "bowling") { EventType eventType = EventType.Bowling; } else if (choice.ToLower() == "amusement park") { EventType eventType = EventType.AmusementPark; } else if (choice.ToLower() == "concert") { EventType eventType = EventType.Concert; } else { Console.WriteLine("Please enter Golf, Bowling, Amusement Park, or Concert \n" + "\n" + "Press any key to continue"); Console.ReadKey(); AddOuting(); } Console.WriteLine("How many people attended? (numbers only please)"); string attendees = Console.ReadLine(); newOuting.AttendeeCount = int.Parse(attendees); Console.WriteLine("What was the date of the event? (mm/dd/yyyy)"); string date = Console.ReadLine(); newOuting.EventDate = DateTime.Parse(date); Console.WriteLine("What was the cost per person?"); Console.Write("$ "); string cost = Console.ReadLine(); newOuting.CostPerPerson = decimal.Parse(cost); _outingRepo.AddOuting(newOuting); Console.WriteLine("\n" + "Outing Added \n" + "\n" + "Press any key to return to main menu"); Console.ReadKey(); Menu(); }
private void AddNewOutingContent() { Console.WriteLine("Please enter the number of attendees:"); string NumberOfAttendeesAsString = Console.ReadLine(); int NumberOfAttendees = int.Parse(NumberOfAttendeesAsString); Console.WriteLine("Please enter the date of the event (mm/dd/yyy):"); DateTime DateOfEvent = DateTime.Parse(Console.ReadLine()); Console.WriteLine("Please enter the Outing Type Number:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert\n" + "5. Exit"); string Type = Console.ReadLine(); OutingType outingType = OutingType.Golf; if (Type == "1") { outingType = OutingType.Golf; } else if (Type == "2") { outingType = OutingType.Bowling; } else if (Type == "3") { outingType = OutingType.AmusementPark; } else if (Type == "4") { outingType = OutingType.Concert; } else if (Type == "5") { Console.WriteLine("Press Enter to return to the Main Menu"); Console.ReadLine(); Run(); } else { Console.WriteLine("Please enter a valid menu option:"); } Console.WriteLine("Please enter the cost per person for this event:"); decimal CostPerPerson = decimal.Parse(Console.ReadLine()); decimal attendees = decimal.Parse(NumberOfAttendees.ToString()); decimal result = (attendees * CostPerPerson); decimal TotalCostOfOutings = result; OutingContent type = new OutingContent(NumberOfAttendees, DateOfEvent, outingType, CostPerPerson, TotalCostOfOutings); _outingRepo.AddOutingContentToList(type); Console.WriteLine("Your new outing content has been added to the list! Please press any key to contiue.."); Console.ReadKey(); Console.Clear(); Run(); }