Beispiel #1
0
        public void AddAndGetEventList()
        {
            EventRepository repo     = new EventRepository();
            Event           eventOne = new Event();
            Event           eventTwo = new Event();

            repo.AddEventToList(eventOne);
            repo.AddEventToList(eventTwo);

            int actual   = repo.GetEventList().Count();
            int expected = 2;

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void TotalCostOfOutingsByType()
        {
            EventRepository repo     = new EventRepository();
            Event           eventOne = new Event(EventType.AmusementPark, 300, DateTime.Now, 52.00m, 1500.00m);
            Event           eventTwo = new Event(EventType.AmusementPark, 432, DateTime.Now, 52.00m, 2000.00m);

            repo.AddEventToList(eventOne);
            repo.AddEventToList(eventTwo);


            decimal actual   = repo.CostOfOutingsByType(EventType.AmusementPark);
            decimal expected = 3500.00m;

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void TotalCostOfAllOutings()
        {
            EventRepository repo       = new EventRepository();
            Event           eventOne   = new Event(EventType.AmusementPark, 300, DateTime.Now, 52.00m, 1500.00m);
            Event           eventTwo   = new Event(EventType.AmusementPark, 432, DateTime.Now, 52.00m, 2000.00m);
            Event           eventThree = new Event(EventType.Bowling, 432, DateTime.Now, 52.00m, 2500.00m);

            repo.AddEventToList(eventOne);
            repo.AddEventToList(eventTwo);
            repo.AddEventToList(eventThree);
            bool calculateTotalCost = true;

            decimal actual   = repo.TotalCostOfAllOutings(calculateTotalCost);
            decimal expected = 6000.00m;

            Assert.AreEqual(expected, actual);
        }
Beispiel #4
0
        public void EventRepository_AddEventToList()
        {
            //Arrange
            EventRepository _eventRepo = new EventRepository();
            Events          eventone   = new Events();
            Events          eventtwo   = new Events();
            Events          eventthree = new Events();

            _eventRepo.AddEventToList(eventone);
            _eventRepo.AddEventToList(eventtwo);
            _eventRepo.AddEventToList(eventthree);

            //Act
            int actual   = _eventRepo.GetEvents().Count;
            int expected = 3;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #5
0
        public void SeedContent()
        {
            Event outingOne = new Event("Golf", 20, new DateTime(2020, 2, 14), 20.5m);

            _eventRepository.AddEventToList(outingOne);
            Event outingTwo = new Event("Golf", 20, new DateTime(2020, 2, 15), 20.5m);

            _eventRepository.AddEventToList(outingTwo);
            Event outingThree = new Event("Bowling", 20, new DateTime(2020, 2, 16), 20.5m);

            _eventRepository.AddEventToList(outingThree);
            Event outingFour = new Event("Bowling", 20, new DateTime(2020, 2, 17), 20.5m);

            _eventRepository.AddEventToList(outingFour);
            Event outingFive = new Event("Movies", 20, new DateTime(2020, 2, 18), 10.5m);

            _eventRepository.AddEventToList(outingFive);
            Event outingSix = new Event("Movies", 20, new DateTime(2020, 2, 19), 10.5m);

            _eventRepository.AddEventToList(outingSix);
        }