static void Main(string[] args) { ConsoleMenu main = new ConsoleMenu("Main Menu"); Regions regions = new Regions(); main.AddEntry(regions.ExecuteInConsole); main.Execute(new MyConsole()); }
public void ConsoleMenu_WhenExecuted_ShouldDisplayHeaderText() { string header_text = "This is the test header text 123455543321"; TestConsole console = new TestConsole(); // Pass a 0 to make the execution stop console.AddInputLine("0"); ConsoleMenu menu = new ConsoleMenu(header_text); menu.Execute(console); Assert.IsTrue(console.OutputContains(header_text)); }
public void ConsoleMenu_WhenExecuted_AndSentZero_ShouldStopExecuting() { TestConsole console = new TestConsole(); console.AddInputLine("0"); ConsoleMenu menu = new ConsoleMenu(""); menu.Execute(console); }