Esempio n. 1
0
        public void MultilineFormatMixedLineEndings()
        {
            string s = "foo" + "\r\n\r\n" + "bar" + "\n" + "baz" + "\n\r\n\n" +
                "jazz" + "\r\n" + "razz" + "\n\n" + "matazz" + "\n" + "end";

            SerialConsoleLogger cl = new SerialConsoleLogger();

            string ss = cl.IndentString(s, 0);

            //should convert lines to system format
            Assertion.AssertEquals("foo" + Environment.NewLine + Environment.NewLine +
                                   "bar" + Environment.NewLine +
                                   "baz" + Environment.NewLine + Environment.NewLine + Environment.NewLine +
                                   "jazz" + Environment.NewLine +
                                   "razz" + Environment.NewLine + Environment.NewLine +
                                   "matazz" + Environment.NewLine +
                                   "end" + Environment.NewLine, ss);
        }
Esempio n. 2
0
        public void MultilineFormatWindowsLineEndings()
        {
            string newline = "\r\n";
            string s = "foo" + newline + "bar" +
                       newline + "baz" + newline;
            SerialConsoleLogger cl = new SerialConsoleLogger();

            string ss = cl.IndentString(s, 4);

            //should convert lines to system format
            Assertion.AssertEquals("    foo" + Environment.NewLine +
                                   "    bar" + Environment.NewLine +
                                   "    baz" + Environment.NewLine + 
                                   "    " + Environment.NewLine, ss); 
        }
Esempio n. 3
0
        public void MultilineFormatUnixLineEndings()
        {
            string s = "foo\nbar\nbaz\n";
            SerialConsoleLogger cl = new SerialConsoleLogger();

            string ss = cl.IndentString(s, 0);

            //should convert lines to system format
            Assertion.AssertEquals("foo" + Environment.NewLine +
                                   "bar" + Environment.NewLine +
                                   "baz" + Environment.NewLine + Environment.NewLine, ss); 
        }
Esempio n. 4
0
        public void SingleLineFormatNoop()
        {
            string s = "foo";
            SerialConsoleLogger cl = new SerialConsoleLogger();

            string ss = cl.IndentString(s, 0);

            //should be a no-op
            Assertion.AssertEquals("foo" + Environment.NewLine, ss); 
        }