コード例 #1
0
 public void DeleteEventsWithGivenNoMatchingTitle()
 {
     IEventsManager eventsManager = new EventsManagerFast();
     eventsManager.AddEvent(sampleEvent);
     eventsManager.DeleteEventsByTitle("High");
     Assert.AreEqual(1, eventsManager.ListEvents(DateTime.MinValue, int.MaxValue).Count());
 }
コード例 #2
0
 public void DeleteEventsByCaseInsensitiveTitle()
 {
     IEventsManager eventsManager = new EventsManagerFast();
     eventsManager.AddEvent(new Event(DateTime.Now, "High-Quality Code Exam", "Telerik Academy"));
     eventsManager.AddEvent(new Event(DateTime.Now, "HIGH-Quality CODE Exam", "Telerik Academy"));
     eventsManager.DeleteEventsByTitle("HIGH-Quality CODE Exam".ToLower());
     Assert.AreEqual(0, eventsManager.ListEvents(DateTime.MinValue, int.MaxValue).Count());
 }
コード例 #3
0
        public void DeleteSingleEvent()
        {
            EventsManagerFast manager = new EventsManagerFast();

            manager.AddEvent(new Event(minDate, "test", null));

            int numDeleted = manager.DeleteEventsByTitle("test");

            Assert.AreEqual(1, numDeleted);

            var eventCount = manager.ListEvents(minDate, 1).Count();

            Assert.AreEqual(0, eventCount);
        }
コード例 #4
0
        public void DeleteMultipleEvents()
        {
            EventsManagerFast manager = new EventsManagerFast();

            manager.AddEvent(new Event(minDate, "test", null));
            manager.AddEvent(new Event(minDate, "test", "bar"));
            manager.AddEvent(new Event(minDate, "other", "bar"));

            int numDeleted = manager.DeleteEventsByTitle("test");

            Assert.AreEqual(2, numDeleted);

            var eventCount = manager.ListEvents(minDate, 3).Count();

            // assert "other" is not deleted
            Assert.AreEqual(1, eventCount);
        }
コード例 #5
0
 public void DeleteEventsWithNullTitle()
 {
     IEventsManager eventsManager = new EventsManagerFast();
     eventsManager.DeleteEventsByTitle(null);
 }