コード例 #1
0
 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('.');
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void Init()
 {
     textEditor = new MockTextEditor();
     console    = new PythonConsole(textEditor, null);
     console.Write(prompt, Style.Prompt);
 }
コード例 #5
0
 public void TwoWrites()
 {
     pythonConsole.Write("a", Style.Out);
     pythonConsole.Write("b", Style.Out);
     Assert.AreEqual("ab", mockTextEditor.Text);
 }