WriteMessage() public method

Writes out a string and a new line using the program name specified in the constructor and message parameter to standard output stream.
Thrown when parameter is null or empty string.
public WriteMessage ( string message ) : void
message string The message to write.
return void
Ejemplo n.º 1
0
        public void Program_name_and_version()
        {
            var hi = new HeadingInfo("myecho", "2.5");
            string s = hi;

            s.Should().Be("myecho 2.5");

            var sw = new StringWriter();
            hi.WriteMessage("hello unit-test", sw);

            sw.ToString().Should().Be("myecho: hello unit-test" + Environment.NewLine);
        }
Ejemplo n.º 2
0
        public void Only_program_name()
        {
            var hi = new HeadingInfo("myprog");
            string s = hi;

            s.Should().Be("myprog");

            var sw = new StringWriter();
            hi.WriteMessage("a message", sw);

            sw.ToString().Should().Be("myprog: a message" + Environment.NewLine);
        }