Mono.Debugger.Test.Framework.LineReader.ReadLine C# (CSharp) Method

ReadLine() public method

public ReadLine ( ) : string
return string
        public string ReadLine()
        {
            for (int i = 0; i < 5; i++) {
                lock (queue.SyncRoot) {
                    if (queue.Count > 0)
                        return (string) queue.Dequeue ();

                    wait_event.Reset ();
                }

                wait_event.WaitOne (3000, false);
            }

            return null;
        }

Usage Example

Ejemplo n.º 1
0
        public void AssertTargetOutput(string line)
        {
            string output = inferior_stdout.ReadLine();

            if (output == null)
            {
                Assert.Fail("No target output.");
            }

            Assert.AreEqual(line, output,
                            "Expected target output `{0}', but got `{1}'.",
                            line, output);
        }
LineReader