public void ListEvents_AddOneEventCorrectListOfEventsCheck() { EventsManagerFast manager = new EventsManagerFast(); DateTime dateOfTheEvent = new DateTime(2013, 05, 25); Event testEvent = new Event(dateOfTheEvent, "MyTestEventTitle"); Event testEventTwo = new Event(dateOfTheEvent, "MyTestEventTitleTwo"); manager.AddEvent(testEvent); manager.AddEvent(testEventTwo); DateTime startDateOfSearch = new DateTime(2012, 01, 01); var allFindEventsInRange = (manager.ListEvents(startDateOfSearch, 100)); int eventCount = 0; foreach (var ev in allFindEventsInRange) { eventCount++; } Assert.AreEqual(2, eventCount); Assert.IsTrue(2 == manager.Count); }
public void ListEvents_EmptyList() { EventsManagerFast manager = new EventsManagerFast(); DateTime startDateOfSearch = new DateTime(2014, 01, 01); var allFindEventsInRange = (manager.ListEvents(startDateOfSearch, 100)); int eventCount = 0; foreach (var ev in allFindEventsInRange) { eventCount++; } Assert.AreEqual(0, eventCount); }
public void ListEvents_NoMachingDateTime() { EventsManagerFast manager = new EventsManagerFast(); DateTime dateOfTheEvent = new DateTime(2013, 05, 25); Event testEvent = new Event(dateOfTheEvent, "MyTestEventTitle"); Event testEventTwo = new Event(dateOfTheEvent, "MyTestEventTitleTwo"); manager.AddEvent(testEvent); manager.AddEvent(testEventTwo); DateTime startDateOfSearch = new DateTime(2014, 01, 01); var allFindEventsInRange = (manager.ListEvents(startDateOfSearch, 100)); int eventCount = 0; foreach (var ev in allFindEventsInRange) { eventCount++; } Assert.AreEqual(0, eventCount); }