void divider_should_renderHeaderAndBlankFooterWhenDefinedInline()
        {
            var tab = new PlainTextTable()
                      .AddRow("Name", "Value")
                      .Divide('-')
                      .AddRow("Data a1", "Data b1")
                      .AddRow("Data a2", "Data b2")
                      .AddRow("Data a3", "Data b3")
                      .Divide('-')
                      .ToString();

            var result = tab.ToString();

            output.WriteLine(result + "EOM");

            string expected = @"Name    Value  
---------------
Data a1 Data b1
Data a2 Data b2
Data a3 Data b3
---------------
";

            Assert.Equal(expected, result);
        }
        void emptyEnumerable_should_renderAnEmptyString()
        {
            var tab = new PlainTextTable(Enumerable.Empty <string[]>());

            var actual = tab.ToString();

            Assert.Equal(string.Empty, actual);
        }
        void render_should_writeSpaceDelimitedTable()
        {
            var tab = new PlainTextTable(create_test_data());

            var result = tab.ToString();

            output.WriteLine(result + "EOM");

            string expected = @"Col A Col B Col C    
R1-A  R1-B  R1-C     
R2-A  R2-B  R2-C long
R3-A  R3-B  R3-C     
";

            Assert.Equal(expected, result);
        }
        void render_should_writeTrimmedRightColumn()
        {
            var tab = new PlainTextTable(create_test_data());

            tab.TrimTrailingSpace(true);

            var result = tab.ToString();

            output.WriteLine(result + "EOM");

            string expected = @"Col A Col B Col C
R1-A  R1-B  R1-C
R2-A  R2-B  R2-C long
R3-A  R3-B  R3-C
";

            Assert.Equal(expected, result);
        }
        void render_should_writeAlignedColumns()
        {
            var tab = new PlainTextTable(create_test_data());

            tab.SeparateBy("|");
            tab.Align('l', 'r', 'm');

            var result = tab.ToString();

            output.WriteLine(result + "EOM");

            string expected = @"Col A|Col B|  Col C  
R1-A | R1-B|  R1-C   
R2-A | R2-B|R2-C long
R3-A | R3-B|  R3-C   
";

            Assert.Equal(expected, result);
        }
        void divider_should_renderHeaderAndSummaryFooter()
        {
            var tab = new PlainTextTable(create_test_data());

            tab.DivideAt(1, '-');
            tab.DivideAt(-2, '-');

            var result = tab.ToString();

            output.WriteLine(result + "EOM");

            string expected = @"Col A Col B Col C    
---------------------
R1-A  R1-B  R1-C     
R2-A  R2-B  R2-C long
---------------------
R3-A  R3-B  R3-C     
";

            Assert.Equal(expected, result);
        }