public void MyTestMethod2_ReturnSum() { //Arrange CompanyOutings_Content eventOne = new CompanyOutings_Content("Golf", 20, "03/23/2020", 72.84d, 1456.80d); CompanyOutings_Content eventTwo = new CompanyOutings_Content("Bowling", 34, "04/13/2020", 10.15d, 345.10d); CompanyOutings repo = new CompanyOutings(); repo.AddContentToList(eventOne); repo.AddContentToList(eventTwo); double eventOneCost = 1456.80d; double eventTwoCost = 345.10d; //Act double expected = eventOneCost + eventTwoCost; //Assert double actual = repo.ReturnSum(); Assert.AreEqual(expected, actual); }
public void MyTestMethod3_ReturnGolf() { //Arrange CompanyOutings_Content eventOne = new CompanyOutings_Content("Golf", 20, "03/23/2020", 72.84d, 1456.80d); CompanyOutings_Content eventTwo = new CompanyOutings_Content("Golf", 15, "04 /30/2020", 66.92d, 1003.80d); CompanyOutings repo = new CompanyOutings(); repo.AddContentToList(eventOne); repo.AddContentToList(eventTwo); double eventOneCost = 1456.80d; double eventTwoCost = 1003.80d; //Act double expected = eventOneCost + eventTwoCost; //Assert double actual = repo.ReturnGolfItemCost(); Assert.AreEqual(expected, actual); }
public void MyTestMethod3_ReturnConcertItem() { //Arrange CompanyOutings_Content eventOne = new CompanyOutings_Content("Concert", 26, "05/29/2020", 55.00d, 1430.00d); CompanyOutings_Content eventTwo = new CompanyOutings_Content("Concert", 45, "06/15/2020", 45.00d, 2025.00d); CompanyOutings repo = new CompanyOutings(); repo.AddContentToList(eventOne); repo.AddContentToList(eventTwo); double eventOneCost = 1430.00d; double eventTwoCost = 2025.00d; //Act double expected = eventOneCost + eventTwoCost; //Assert double actual = repo.ReturnConcertItemCost(); Assert.AreEqual(expected, actual); }
public void AddOuting() { Console.Clear(); CompanyOutings_Content newOuting = new CompanyOutings_Content(); bool keepRunning = true; while (keepRunning) { Console.Write("Enter the event type (Golf, Bowling, Amusement Park or Concert): "); string type = Console.ReadLine(); if (type == "Golf" || type == "Bowling" || type == "Amusement Park" || type == "Concert") { newOuting.EventType = type; keepRunning = false; } else { Console.WriteLine("Please enter a valid event type."); } } Console.Write("Enter number of people attending: "); string numberOfPeople = Console.ReadLine(); newOuting.NumberInAttendance = int.Parse(numberOfPeople); int numberOfPeopleInt = int.Parse(numberOfPeople); Console.Write("Enter the date of the event: "); newOuting.DateOfEvent = Console.ReadLine(); Console.Write("Enter cost per person: "); string costPerPerson = Console.ReadLine(); newOuting.CostPerPerson = double.Parse(costPerPerson); double costPerPersonInt = double.Parse(costPerPerson); newOuting.CostOfEvent = (costPerPersonInt * numberOfPeopleInt); _repo.AddContentToList(newOuting); }