Ejemplo n.º 1
0
 public void TestWriteMovesTheCursorPositionBackToZeroWhenTextStartsWithCarriageReturn()
 {
     var console = new MockConsole();
     console.Write("Yo Dawg");
     console.Write("\rHi");
     Assert.AreEqual("Hi Dawg", console.Text);
 }
Ejemplo n.º 2
0
 public void TestWriteDoesNotResetTheCursorWhenTextStartsWithCarriageReturnLineFeed()
 {
     var console = new MockConsole();
     console.Write("Yo Dawg");
     console.Write(Environment.NewLine + "Hi");
     Assert.AreEqual("Yo Dawg" + Environment.NewLine + "Hi", console.Text);
 }
Ejemplo n.º 3
0
 public void TestCarriageReturnDoesNotOverwriteNewlines()
 {
     var console = new MockConsole();
     console.WriteLine("Yo Dawg");
     console.Write("\rHi");
     Assert.AreEqual("Yo Dawg" + Environment.NewLine + "Hi", console.Text);
 }
Ejemplo n.º 4
0
        public void TestWriteAppendsTextToOutputBuffer()
        {
            var console = new MockConsole();

            console.Write("Yo Dawg");
            Assert.AreEqual("Yo Dawg", console.Text);

            console.Write(", I heard you liked tests so I wrote some tests for your tests.");
            Assert.AreEqual("Yo Dawg, I heard you liked tests so I wrote some tests for your tests.", console.Text);
        }
Ejemplo n.º 5
0
 public void Init()
 {
     console = new MockConsole();
     Console.SetOut(console);
     progressBar = new ProgressBar(100, "Yo Dawg", 30);
 }