示例#1
0
        public void ListEventsWithMoreElementsThanWishedTest()
        {
            EventsManagerFast eventsManager = new EventsManagerFast();

            DateTime firstDate = new DateTime(2002, 01, 02, 02, 02, 02);
            CalendarEvent firstEvent = new CalendarEvent(firstDate, "Title", null);

            DateTime secondDate = new DateTime(2003, 01, 02, 02, 02, 02);
            CalendarEvent secondEvent = new CalendarEvent(secondDate, "Title", null);

            DateTime thirdDate = new DateTime(2003, 01, 02, 02, 02, 02);
            CalendarEvent thirdEvent = new CalendarEvent(thirdDate, "Title", null);

            eventsManager.AddEvent(firstEvent);
            eventsManager.AddEvent(secondEvent);
            eventsManager.AddEvent(thirdEvent);

            DateTime startDate = new DateTime(2001, 01, 02, 00, 00, 00);
            IEnumerable<CalendarEvent> resultList = eventsManager.ListEvents(startDate, 2);

            int count = 0;
            foreach (var ev in resultList)
            {
                count = count + 1;
            }

            Assert.AreEqual(2, count);
        }
示例#2
0
        public void ListEventWith1000CountTest()
        {
            EventsManagerFast eventsManager = new EventsManagerFast();

            DateTime startDate = new DateTime(2005, 01, 02, 00, 00, 00);
            IEnumerable<CalendarEvent> resultList = eventsManager.ListEvents(startDate, 1000);
        }
示例#3
0
        public void ListEventsWhenNoExistTest()
        {
            EventsManagerFast eventsManager = new EventsManagerFast();

            DateTime startDate = new DateTime(2001, 01, 02, 00, 00, 00);
            IEnumerable<CalendarEvent> resultList = eventsManager.ListEvents(startDate, 2);

            int count = 0;
            foreach (var ev in resultList)
            {
                count = count + 1;
            }

            Assert.AreEqual(0, count);
        }