public void Init() { mockTextEditor = new MockTextEditor(); RubyConsole = new RubyConsole(mockTextEditor, null); autoIndentSize = initialAutoIndentSize; Thread thread = new Thread(ReadLineFromConsoleOnDifferentThread); thread.Start(); int sleepInterval = 10; int maxWait = 2000; int currentWait = 0; while (mockTextEditor.Text.Length < autoIndentSize && currentWait < maxWait) { Thread.Sleep(sleepInterval); currentWait += sleepInterval; } raiseKeyPressEvent = mockTextEditor.RaiseKeyPressEvent('a'); raiseDialogKeyPressEvent = mockTextEditor.RaiseDialogKeyPressEvent(Keys.Enter); currentWait = 0; while ((mockTextEditor.Text.Length < autoIndentSize + 2) && (currentWait < maxWait)) { Thread.Sleep(10); currentWait += sleepInterval; } thread.Join(2000); }
public void SetUpFixture() { MockTextEditor textEditor = new MockTextEditor(); using (RubyConsole = new RubyConsole(textEditor, null)) { textEditor.RaiseKeyPressEvent('a'); textEditor.RaiseKeyPressEvent('='); textEditor.RaiseKeyPressEvent('1'); lineAvailableBeforeFirstEnterKey = RubyConsole.IsLineAvailable; textEditor.RaiseDialogKeyPressEvent(Keys.Enter); lineAvailableAfterFirstEnterKey = RubyConsole.IsLineAvailable; textEditor.RaiseKeyPressEvent('b'); textEditor.RaiseKeyPressEvent('='); textEditor.RaiseKeyPressEvent('2'); textEditor.RaiseDialogKeyPressEvent(Keys.Enter); Thread t = new Thread(ReadLinesOnSeparateThread); t.Start(); int sleepInterval = 20; int currentWait = 0; int maxWait = 2000; while (line2 == null && currentWait < maxWait) { Thread.Sleep(sleepInterval); currentWait += sleepInterval; } lineAvailableAtEnd = RubyConsole.IsLineAvailable; } }
public void SetUpFixture() { textEditor = new MockTextEditor(); console = new RubyConsole(textEditor, null); console.WriteLine(prompt, Style.Prompt); textEditor.RaiseKeyPressEvents("a"); showCompletionWindowCalledBeforeDotTypedIn = textEditor.IsShowCompletionWindowCalled; textEditor.RaiseKeyPressEvent('.'); }
public void NoTextWrittenWhenAutoIndentSizeIsZero() { MockTextEditor textEditor = new MockTextEditor(); RubyConsole console = new RubyConsole(textEditor, null); textEditor.RaiseKeyPressEvent('a'); textEditor.RaiseDialogKeyPressEvent(Keys.Enter); textEditor.IsWriteCalled = false; console.ReadLine(0); Assert.IsFalse(textEditor.IsWriteCalled); }
public void Init() { textEditor = new MockTextEditor(); RubyConsole = new RubyConsole(textEditor, null); RubyConsole.Write(prompt, Style.Prompt); textEditor.RaiseKeyPressEvent('a'); textEditor.RaiseDialogKeyPressEvent(Keys.Enter); RubyConsole.Write(prompt, Style.Prompt); textEditor.RaiseKeyPressEvent('b'); textEditor.RaiseKeyPressEvent('.'); }
public void Init() { mockTextEditor = new MockTextEditor(); mockTextEditor.Text = String.Empty; RubyConsole = new RubyConsole(mockTextEditor, null); }
public void Init() { textEditor = new MockTextEditor(); RubyConsole = new RubyConsole(textEditor, null); RubyConsole.Write(prompt, Style.Prompt); }
public void SetUpFixture() { textEditor = new MockTextEditor(); stream = new RubyOutputStream(textEditor); }
public void Init() { textEditor = new MockTextEditor(); RubyConsole = new RubyConsole(textEditor, null); }