public void TestWriteMovesTheCursorPositionBackToZeroWhenTextStartsWithCarriageReturn() { var console = new MockConsole(); console.Write("Yo Dawg"); console.Write("\rHi"); Assert.AreEqual("Hi Dawg", console.Text); }
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); }
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); }
public void TestCarriageReturnDoesNotOverwriteNewlines() { var console = new MockConsole(); console.WriteLine("Yo Dawg"); console.Write("\rHi"); Assert.AreEqual("Yo Dawg" + Environment.NewLine + "Hi", console.Text); }