public void ListEventsTest() { EventsManagerFast eventsManager = new EventsManagerFast(); string dateInput = "2000-11-13T00:00:01"; for (int i = 0; i < 10; i++) { DateTime date = CreateDate(dateInput); Event testEvent = new Event(date, i.ToString()); eventsManager.AddEvent(testEvent); } DateTime dateCheck = CreateDate(dateInput); int eventsCount = 10; IEnumerable<Event> events = eventsManager.ListEvents(dateCheck, eventsCount); int target = 0; foreach (var ev in events) { target += 1; Assert.AreEqual<DateTime>(ev.Date, dateCheck); } Assert.IsTrue(target == eventsCount); }
public void ListEventsWhenThereAreNoItemsTest() { EventsManagerFast eventsManager = new EventsManagerFast(); string dateInput = "2000-11-13T00:00:01"; DateTime dateCheck = CreateDate(dateInput); int eventsCount = 10; IEnumerable<Event> events = eventsManager.ListEvents(dateCheck, eventsCount); int target = 0; foreach (var ev in events) { target += 1; } Assert.IsTrue(target == 0); }