Пример #1
0
        public void ReadLineReturnsNullWhenConsoleDisposed()
        {
            RubyConsole console = new RubyConsole(new MockTextEditor(), null);

            console.Dispose();
            Assert.IsNull(console.ReadLine(0));
        }
Пример #2
0
        public void HostDisposesRubyConsole()
        {
            DerivedRubyConsoleHost host    = new DerivedRubyConsoleHost(new MockTextEditor());
            RubyConsole            console = host.CallCreateConsole(null, null, null) as RubyConsole;

            host.Dispose();

            Assert.IsNull(console.ReadLine(0));
        }
Пример #3
0
        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);
        }
Пример #4
0
 void ReadLineFromConsoleOnDifferentThread()
 {
     System.Console.WriteLine("Reading on different thread");
     readLine = RubyConsole.ReadLine(autoIndentSize);
     System.Console.WriteLine("Finished reading on different thread");
 }
 void ReadLinesOnSeparateThread()
 {
     line1 = RubyConsole.ReadLine(0);
     line2 = RubyConsole.ReadLine(0);
 }