internal static void Main()
        {
            EventsManagerFast eventManager = new EventsManagerFast();
            CommandExecutor commandExecutor = new CommandExecutor(eventManager);
            bool notEndCommand = true;

            while (notEndCommand)
            {
                string currenrCommandLine = Console.ReadLine();
                if (null == currenrCommandLine || currenrCommandLine == "End")
                {
                    notEndCommand = false;
                    break;
                }
                else
                {
                    try
                    {
                        Command currentCommand = Command.Parse(currenrCommandLine);
                        string outputText = commandExecutor.ProcessCommand(currentCommand);
                        Console.WriteLine(outputText);
                    }
                    catch (FormatException ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }
            }
        }
 public void AddEvent_AddOneEventCorrect()
 {
     EventsManagerFast manager = new EventsManagerFast();
     DateTime dateOfTheEvent = new DateTime(2013,05,25);
     Event testEvent = new Event(dateOfTheEvent,"MyTestEventTitle");
     manager.AddEvent(testEvent);
     int eventsCount = manager.Count;
     Assert.IsTrue(1 == eventsCount);
 }
        public void DeleteEventsByTitle_CorrectDelete()
        {
            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);
            manager.DeleteEventsByTitle("MyTestEventTitle");

            Assert.IsTrue(1 == manager.Count);
        }
        public void DeleteEventsByTitle_NotExistingEvent()
        {
            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);
            int numberOfDeletedEvents = manager.DeleteEventsByTitle("NotExistingEventName");

            Assert.IsTrue(2 == manager.Count);
            Assert.IsTrue(0 == numberOfDeletedEvents);
        }
        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);
        }