Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3816 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
6 changed files with 78 additions and 0 deletions
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
// <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.Windows.Forms; |
||||
|
||||
using ICSharpCode.PythonBinding; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.TextEditor.Gui.CompletionWindow; |
||||
using Microsoft.Scripting.Hosting.Shell; |
||||
using NUnit.Framework; |
||||
using PythonBinding.Tests.Utils; |
||||
|
||||
namespace PythonBinding.Tests.Console |
||||
{ |
||||
/// <summary>
|
||||
/// Pressing the up key closes the completion window when it should not. This fixture tests
|
||||
/// that the up, down, home and end key do not close this window.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class KeysPressedWhenCompletionWindowOpenTestFixture |
||||
{ |
||||
PythonConsole pythonConsole; |
||||
MockTextEditor textEditor; |
||||
string prompt = ">>> "; |
||||
|
||||
[SetUp] |
||||
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('.'); |
||||
} |
||||
|
||||
[Test] |
||||
public void UpKeyDoesNothing() |
||||
{ |
||||
Assert.IsFalse(textEditor.RaiseDialogKeyPressEvent(Keys.Up)); |
||||
} |
||||
|
||||
[Test] |
||||
public void DownKeyDoesNothing() |
||||
{ |
||||
Assert.IsFalse(textEditor.RaiseDialogKeyPressEvent(Keys.Down)); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue