Ejemplo n.º 1
0
        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 = "> _";
        }
Ejemplo n.º 2
0
        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);
        }