Example #1
0
        public void AddEventToListShouldBeEqual()
        {
            EventRepository eventRepository = new EventRepository();

            Event @event1 = new Event();
            Event @event2 = new Event();
            Event @event3 = new Event();

            eventRepository.AddNewEvent(@event1);
            eventRepository.AddNewEvent(@event2);
            eventRepository.AddNewEvent(@event3);

            int actual   = eventRepository.ListAllEvents().Count;
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void SumOfSpecifiedEvents()
        {
            EventRepository eventRepository = new EventRepository();


            Event @event1 = new Event(EventType.Concert, 45, DateTime.Now, 45000m, 1000m);
            Event @event2 = new Event(EventType.Concert, 60, DateTime.Now, 60000m, 1000m);
            Event @event3 = new Event(EventType.Bowling, 25, DateTime.Now, 2500m, 100m);

            eventRepository.AddNewEvent(@event1);
            eventRepository.AddNewEvent(@event2);
            eventRepository.AddNewEvent(@event3);

            List <Event> events = eventRepository.ListAllEvents();

            decimal actual   = eventRepository.SumOfSpecifiedEvents(events, EventType.Bowling);
            decimal expected = 2500m;

            Assert.AreEqual(expected, actual);
        }