コード例 #1
0
        public void AddRow_WithOneHeaderAndOneRow_ShouldAddRowToList()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a").WithRow("b");

            Assert.AreEqual("b", table.Rows.First().Columns.First());
        }
コード例 #2
0
        public void AddHeader_WithoutAlignmentValue_ShouldUseAlignmentLeftAsDefaultValue()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a");

            Assert.AreEqual(PrintableDataRowAlignment.Left, table.Headers.First().Alignment);
        }
コード例 #3
0
        public void AddHeader_WithOneHeader_ShouldAddHeaderToList()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a");

            Assert.AreEqual("a", table.Headers.First().Title);
        }
コード例 #4
0
        public void Print_WithOneHeaderAlignmentLeft_ShouldPrintExpectedTableWithAlignmentLeft()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a", PrintableDataRowAlignment.Left).WithRow("b");

            Assert.AreEqual("|a|\n|:-----|\n|b|", table.Print());
        }
コード例 #5
0
        public void Print_WithOneHeaderAndOneDataRow_ShouldPrintExpectedTable()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a").WithRow("b");

            Assert.AreEqual("|a|\n|:-----|\n|b|", table.Print());
        }
コード例 #6
0
        public void AddRow_WithOneHeaderAndOneDataRowWithTwoHeaders_ShouldThrowIndexOutOfRangeException()
        {
            IPrintableParagraphTable table = new MarkdownTable();

            table.WithHeader("a").WithRow("b", "c");
        }