public void cursor_top_should_show_current_line() { var console = new MockConsole(80, 20); Assert.AreEqual(0, console.Y); console.WriteLine("line1"); Assert.AreEqual(1, console.Y); console.Write("This "); Assert.AreEqual(1, console.Y); console.Write("is "); Assert.AreEqual(1, console.Y); console.WriteLine("a test line."); Assert.AreEqual(2, console.Y); console.WriteLine("line 3"); Assert.AreEqual(3, console.Y); }
public void write_and_write_line_simple_usages() { var console = new MockConsole(80, 20); console.WriteLine("line1"); console.Write("This "); console.Write("is "); console.WriteLine("a test line."); console.WriteLine("line 3"); var expected = new[] { "line1", "This is a test line.", "line 3" }; Console.WriteLine(console.Buffer); Assert.That(console.LinesTextTrimmed, Is.EqualTo(expected)); }