// #2 on menu private void CreateNewOuting() { Clear(); Outings newOuting = new Outings(); WriteLine("\nEnter the Outing Type Number:\n" + "1. Golf\n" + "2. Bowling\n" + "3. Amusement Park\n" + "4. Concert\n"); int outingTypeInt = Int32.Parse(ReadLine()); newOuting.OutingType = (OutingType)outingTypeInt; WriteLine("\nEnter the Date of the Outing (mm/dd/yy):"); newOuting.DateOfEvent = ReadLine(); WriteLine("\nEnter the Number of People Attending:"); newOuting.NumOfPeople = Int32.Parse(ReadLine()); WriteLine("\nEnter the Cost Per Person of the Event:"); newOuting.CostPerPerson = Int32.Parse(ReadLine()); _outingsRepo.AddOutingsToList(newOuting); }
public void OutingRepository_AddOutingToList_ShouldReturnCorrectCount() { //Arrange List <Outings> outingsList = _outingsRepository.GetOutingsList(); _outingsRepository.AddOutingsToList(new Outings()); //Act int actual = outingsList.Count; int expected = 1; //Assert Assert.AreEqual(expected, actual); }
public void OutingsRepository_GetOutingsCostByType_ShouldReturnCorrectAmount() { _outingsRepo.GetOutingsList(); //Arrange Outings ConcertOutingOne = new Outings(); //you are basically creating a new object with values to test ConcertOutingOne.TypeOfEvent = EventType.Concert; //property on left, enum value on right ConcertOutingOne.TotalEventCost = 100; _outingsRepo.AddOutingsToList(ConcertOutingOne); Outings ConcertOutingTwo = new Outings(); ConcertOutingTwo.TypeOfEvent = EventType.Concert; //property on left, enum value on right ConcertOutingTwo.TotalEventCost = 200; _outingsRepo.AddOutingsToList(ConcertOutingTwo); //Act double actual = _outingsRepo.GetOutingsCostByType(EventType.Concert); double expected = 300; //Assert Assert.AreEqual(expected, actual); }
//helper methods private void SetTestContent() { _outingsTestRepo = new OutingsRepository(); _outingsTestRepo.AddOutingsToList(outing); }