Ejemplo n.º 1
0
        private static void Main()
        {
            IEventsManager eventManager = new EventManager();
            var commandManager = new CommandManager(eventManager);

            while (true)
            {
                string commandInput = Console.ReadLine();

                if (commandInput == "End")
                {
                    break;
                }

                try
                {
                    Command command = Command.Parse(commandInput);
                    string commandResult = commandManager.ProcessCommand(command);
                    Console.WriteLine(commandResult);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Ejemplo n.º 2
0
        public void EventManagerAddEventValidEventShouldBeAddedCorect()
        {
            var manager = new EventManager();
            manager.AddEvent(new Event("Test title", "Location", DateTime.Now));

            Assert.AreEqual(1, manager.EventsList.Count);
        }
Ejemplo n.º 3
0
        public void EventManagerDeleteValidParameterShouldDeleteEvent()
        {
            var manager = new EventManager();

            manager.EventsList.Add(new Event("Test title1", "Location1", new DateTime(2014, 12, 31)));
            manager.DeleteEventsByTitle("Test title1");

            Assert.AreEqual(0, manager.EventsList.Count);
        }
Ejemplo n.º 4
0
        public static void Main()
        {
            var eventManager = new EventManager();

            CommandExecutor cmdExecutor = new CommandExecutor(eventManager);

            var commands = ReadUserInput();
            foreach (var command in commands)
            {

                Console.WriteLine(cmdExecutor.ProcessCommand(command));
            }
        }
Ejemplo n.º 5
0
 public void EventManagerDeleteEventsByTitleNullParameterShouldThrow()
 {
     var manager = new EventManager();
     manager.DeleteEventsByTitle(null);
 }
Ejemplo n.º 6
0
 public void EventManagerAddEventWithNullShouldThrow()
 {
     var manager = new EventManager();
     manager.AddEvent(null);
 }
Ejemplo n.º 7
0
 public void EventManagerAddEventValidEventShouldNotThrow()
 {
     var manager = new EventManager();
     manager.AddEvent(new Event("Test title", "Location", DateTime.Now));
 }