예제 #1
0
        public void Execute_CommandCantBeParsed_ThrowMenuException()
        {
            // Arrange
            string command = "InsertImageimg.png";

            // Act
            // Assert
            Assert.Throws <MenuException>(() => _menu.Execute(command));
        }
예제 #2
0
파일: Program.cs 프로젝트: egoshin-igor/OOD
        private static void Run(Menu.Menu menu)
        {
            var isExit = false;

            while (!isExit)
            {
                string command = Console.ReadLine();
                if (command.ToLower() == "exit")
                {
                    break;
                }

                try
                {
                    menu.Execute(command);
                }
                catch (MenuException ex)
                {
                    Console.WriteLine(ex.Message);
                }
                catch (DocumentException ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }