public void CanMoveOutOfPromptRegionWithUpCursorKey() { textEditor.RaiseDialogKeyPressEvent(Keys.Enter); console.Write(prompt, Style.Prompt); textEditor.Column = 0; Assert.IsFalse(textEditor.RaiseDialogKeyPressEvent(Keys.Up)); }
public void Init() { textEditor = new MockTextEditor(); pythonConsole = new PythonConsole(textEditor, null); pythonConsole.Write(prompt, Style.Prompt); textEditor.RaiseKeyPressEvent('a'); textEditor.RaiseDialogKeyPressEvent(Keys.Enter); pythonConsole.Write(prompt, Style.Prompt); textEditor.RaiseKeyPressEvent('b'); textEditor.RaiseKeyPressEvent('.'); }
public void PreviousLineIsReadOnlyAfterEnterPressed() { textEditor.RaiseKeyPressEvent('a'); textEditor.RaiseKeyPressEvent('b'); textEditor.RaiseDialogKeyPressEvent(Keys.Enter); console.Write(prompt, Style.Prompt); // Move up a line with cursor. textEditor.Line = 0; Assert.IsTrue(textEditor.RaiseKeyPressEvent('c')); string expectedText = ">>> ab\r\n" + ">>> "; Assert.AreEqual(expectedText, textEditor.Text); }
public void Init() { textEditor = new MockTextEditor(); console = new PythonConsole(textEditor, null); console.Write(prompt, Style.Prompt); }
public void TwoWrites() { pythonConsole.Write("a", Style.Out); pythonConsole.Write("b", Style.Out); Assert.AreEqual("ab", mockTextEditor.Text); }