public void Execute_CommandCantBeParsed_ThrowMenuException() { // Arrange string command = "InsertImageimg.png"; // Act // Assert Assert.Throws <MenuException>(() => _menu.Execute(command)); }
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); } } }