Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3618 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
3 changed files with 57 additions and 0 deletions
@ -0,0 +1,45 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Windows.Forms; |
||||||
|
using System.Threading; |
||||||
|
using Microsoft.Scripting.Hosting.Shell; |
||||||
|
using ICSharpCode.PythonBinding; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace PythonBinding.Tests.Console |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// The Home Key should return the user to the start of the line after the prompt.
|
||||||
|
/// </summary>
|
||||||
|
[TestFixture] |
||||||
|
public class PythonConsoleHomeKeyTestFixture |
||||||
|
{ |
||||||
|
MockTextEditor textEditor; |
||||||
|
PythonConsole console; |
||||||
|
string prompt = ">>> "; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
textEditor = new MockTextEditor(); |
||||||
|
console = new PythonConsole(textEditor, null); |
||||||
|
console.Write(prompt, Style.Prompt); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void HomeKeyPressedWhenNoUserTextInConsole() |
||||||
|
{ |
||||||
|
textEditor.RaiseDialogKeyPressEvent(Keys.Home); |
||||||
|
|
||||||
|
int expectedColumn = prompt.Length; |
||||||
|
Assert.AreEqual(expectedColumn, textEditor.Column); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue