private void ExecuteCommandAndMoveToHistory() { string input = string.Join(" ", Text.SplitAndTrim(" ")); commands.Add(input); commandsPosition = commands.Count; AddToHistory("> " + input); AddToHistory(consoleCommands.ExecuteCommand(input)); history.Text = string.Join("\n", historyLines); command.Text = "> _"; }
private void Button1_Click(object sender, EventArgs e) { TextBox tb = textBox1; string t = tb.Text; if (t.Length > 0) { commands.ExecuteCommand(t); tb.Clear(); } }
public void ExecuteUnknownCommand() { string result = consoleCommands.ExecuteCommand("NotRegistered"); Assert.AreEqual("Error: Unknown console command 'NotRegistered'", result); }