Write() public method

public Write ( string format ) : void
format string
return void
コード例 #1
0
 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);
 }
コード例 #2
0
        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));
        }