1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Windows.Input;
7
using ICSharpCode.Scripting;
8
using ICSharpCode.Scripting.Tests.Utils;
11
namespace ICSharpCode.Scripting.Tests.Console
14
/// Tests the ScriptingConsole's GetUnreadLines method.
17
public class ScriptingConsoleUnreadLinesTests : ScriptingConsoleTestsBase
26
public void NoUnreadLinesAtStart()
28
int length = TestableScriptingConsole.GetUnreadLines().Length;
29
Assert.AreEqual(0, length);
33
public void HasUnreadLines()
35
Assert.IsFalse(TestableScriptingConsole.IsLineAvailable);
39
public void AddOneLine()
41
FakeConsoleTextEditor.RaisePreviewKeyDownEvent(System.Windows.Input.Key.A);
42
FakeConsoleTextEditor.RaisePreviewKeyDownEventForDialogKey(System.Windows.Input.Key.Enter);
44
string[] lines = TestableScriptingConsole.GetUnreadLines();
45
string[] expectedLines = new string[] {"A"};
47
Assert.AreEqual(expectedLines, lines);
48
Assert.IsTrue(TestableScriptingConsole.IsLineAvailable);