Browse Source

Add extra text helper methods to save text written to scripting console.

pull/15/head
Matt Ward 15 years ago
parent
commit
6888b03202
  1. 7
      src/AddIns/BackendBindings/Scripting/Test/Utils/FakeScriptingConsole.cs

7
src/AddIns/BackendBindings/Scripting/Test/Utils/FakeScriptingConsole.cs

@ -17,6 +17,7 @@ namespace ICSharpCode.Scripting.Tests.Utils
public ScriptingStyle ScriptingStylePassedToWriteLine; public ScriptingStyle ScriptingStylePassedToWriteLine;
public string TextPassedToWrite; public string TextPassedToWrite;
public List<string> AllTextPassedToWrite = new List<string>(); public List<string> AllTextPassedToWrite = new List<string>();
public List<string> AllTextPassedToWriteLine = new List<string>();
public ScriptingStyle ScriptingStylePassedToWrite; public ScriptingStyle ScriptingStylePassedToWrite;
public string TextToReturnFromReadLine; public string TextToReturnFromReadLine;
public int AutoIndentSizePassedToReadLine; public int AutoIndentSizePassedToReadLine;
@ -25,6 +26,10 @@ namespace ICSharpCode.Scripting.Tests.Utils
public bool IsDisposeCalled; public bool IsDisposeCalled;
public int MaximumVisibleColumns; public int MaximumVisibleColumns;
public string LastLinePassedToWriteLine {
get { return AllTextPassedToWriteLine[AllTextPassedToWriteLine.Count - 1]; }
}
public bool ScrollToEndWhenTextWritten { get; set; } public bool ScrollToEndWhenTextWritten { get; set; }
public void SendLine(string text) public void SendLine(string text)
@ -40,12 +45,14 @@ namespace ICSharpCode.Scripting.Tests.Utils
public void WriteLine() public void WriteLine()
{ {
IsWriteLineCalled = true; IsWriteLineCalled = true;
AllTextPassedToWriteLine.Add(String.Empty);
} }
public void WriteLine(string text, ScriptingStyle style) public void WriteLine(string text, ScriptingStyle style)
{ {
TextPassedToWriteLine = text; TextPassedToWriteLine = text;
ScriptingStylePassedToWriteLine = style; ScriptingStylePassedToWriteLine = style;
AllTextPassedToWriteLine.Add(text);
} }
public void Write(string text, ScriptingStyle style) public void Write(string text, ScriptingStyle style)

Loading…
Cancel
Save