Example #1
0
        public void Should_Read_Output_To_The_End()
        {
            var console = new EnhancedConsole();

            Assert.That(console.ReadAll(), Is.Not.Null, "Output is null");

            console.Write('d');
            console.Write('i');
            console.Write('r');
            console.Write((char)13);

            Assert.That(console.ReadAll(), Contains.Substring("dir"), "user command doesn't exist");

            Close(console);
        }
 public void UpdateConsole()
 {
     tbxConsole.Document.Text = _console.ReadAll();
     tbxConsole.ScrollToEnd();
     _offsetColorizer.StartOffset = 0;
     _offsetColorizer.EndOffset   = 200;
 }
Example #3
0
        public void ReadAll_Should_Read_The_Last_Line_Without_Empty_Spaces()
        {
            var console = new EnhancedConsole();

            string content = console.ReadAll();

            Assert.That(content.Substring(content.Length - 1, 1), Is.EqualTo(">"));

            Close(console);
        }
Example #4
0
        public void ReadAll_Should_Truncate_Empty_Lines()
        {
            var console = new EnhancedConsole();

            string content = console.ReadAll();

            Assert.That(content.Split(new string[] { "\r\n" }, StringSplitOptions.None).Length, Is.EqualTo(5));

            Close(console);
        }
Example #5
0
        public void ReadAll_Ignore_NewLine_In_The_Console_Other_ThanNextLine()
        {
            var console = new EnhancedConsole();

            for (int i = 0; i < 120; i++)
            {
                console.Write(i.ToString().ToCharArray()[0]);
            }

            string content = console.ReadAll();
        }