public void TestDeleteEvents_Delete2Of3() { FastEventsManager eventManager = new FastEventsManager(); Event eventItem1 = new Event(); eventItem1.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem1.Title = "party"; eventItem1.Location = "nowhere"; eventManager.AddEvent(eventItem1); Event eventItem2 = new Event(); eventItem2.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem2.Title = "no party"; eventManager.AddEvent(eventItem2); Event eventItem3 = new Event(); eventItem3.Date = DateTime.ParseExact( "2011-02-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem3.Title = "party"; eventItem3.Location = "Telerik"; eventManager.AddEvent(eventItem3); int deletedEvents = eventManager.DeleteEventsByTitle("party"); Assert.AreEqual(2, deletedEvents); }
public void TestDeleteEvents_Delete1CheckCaseSensitivity() { FastEventsManager eventManager = new FastEventsManager(); Event eventItem = new Event(); eventItem.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem.Title = "pArTy"; eventItem.Location = "nowhere"; eventManager.AddEvent(eventItem); int deletedEvents = eventManager.DeleteEventsByTitle("party"); Assert.AreEqual(1, deletedEvents); }
public void TestListEvents_OneEventBeforeTheSearchedOne() { FastEventsManager eventManager = new FastEventsManager(); Event eventItem1 = new Event(); eventItem1.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem1.Title = "party"; eventItem1.Location = "nowhere"; eventManager.AddEvent(eventItem1); Event eventItem2 = new Event(); eventItem2.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem2.Title = "no party"; eventManager.AddEvent(eventItem2); Event eventItem3 = new Event(); eventItem3.Date = DateTime.ParseExact( "2000-02-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem3.Title = "C#"; eventItem3.Location = "Telerik"; eventManager.AddEvent(eventItem3); var eventsList = eventManager.ListEvents( DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture), 10); int eventsCount = eventsList.Count(); Assert.AreEqual(2, eventsCount); }
public void TestListEvents_List1() { FastEventsManager eventManager = new FastEventsManager(); Event eventItem = new Event(); eventItem.Date = DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture); eventItem.Title = "party"; eventItem.Location = "nowhere"; eventManager.AddEvent(eventItem); var eventsList = eventManager.ListEvents( DateTime.ParseExact( "2001-01-01T10:00:00", "yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture), 10); int eventsCount = eventsList.Count(); Assert.AreEqual(1, eventsCount); }