示例#1
0
        private void DisplayOutings()
        {
            List <Outings> listOfOutings = _outingsRepo.GetOutingsList();

            listOfOutings.Sort(delegate(Outings x, Outings y)
            {
                return(x.DateOfEvent.CompareTo(y.DateOfEvent));
            });
            Console.WriteLine("\n");
            List <string> headings = new List <string> {
                "Type Of Event", "Attendees", "Date of Event", "Cost per Person", "Cost of Event"
            };

            Console.Clear();
            Console.WriteLine($"\n{headings[0],-20} {headings[1],-12} {headings[2],-15} {headings[3],-18} {headings[4],-20}");
            foreach (Outings outing in listOfOutings)
            {
                string type          = outing.TypeOfOuting.ToString();
                string numAttendees  = outing.NumAttendees.ToString();
                string eventDate     = outing.DateOfEvent.ToString("M/dd/yy");
                string costPerPerson = outing.CostPerPerson.ToString("n2");
                string costEvent     = outing.CostEvent.ToString("n2");
                Console.WriteLine($"{type, -20} {numAttendees,-12} {eventDate,-15} ${costPerPerson,-18} ${costEvent,-20} ");
            }
        }
        public void OutingsRepository_GetOutingsList_ShouldReturnCorrectCount()
        {
            //Arrange
            var _outingsList = _outingsRepo.GetOutingsList();      //when do you use var vs. the list of menu "Type"

            //Act
            var actual   = _outingsList.Count;
            var expected = 0;

            //Assert
            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void AddOutingsToListTest()
        {
            SetTestContent();

            List <Outings> outingsList = _outingsTestRepo.GetOutingsList();

            foreach (Outings outing in outingsList)
            {
                string outingDate = outing.DateOfEvent;

                Assert.AreEqual(outingDate, outing.DateOfEvent);
            }
        }
示例#4
0
        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);
        }
        //#1 on munu
        private void ViewOutings()
        {
            Clear();
            List <Outings> viewOutingsList = _outingsRepo.GetOutingsList();

            foreach (Outings viewOutings in viewOutingsList)
            {
                WriteLine($"\nOuting Type: {viewOutings.OutingType}" +
                          $"\nNumber of People Attending: {viewOutings.NumOfPeople}" +
                          $"\nOuting Date: {viewOutings.DateOfEvent}" +
                          $"\nCost of the Event: ${viewOutings.CostOfEvent}" +
                          $"\nCost Per Person: ${viewOutings.CostPerPerson}");
            }
        }