public void AddRow_WithOneHeaderAndOneRow_ShouldAddRowToList() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a").WithRow("b"); Assert.AreEqual("b", table.Rows.First().Columns.First()); }
public void AddHeader_WithoutAlignmentValue_ShouldUseAlignmentLeftAsDefaultValue() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a"); Assert.AreEqual(PrintableDataRowAlignment.Left, table.Headers.First().Alignment); }
public void AddHeader_WithOneHeader_ShouldAddHeaderToList() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a"); Assert.AreEqual("a", table.Headers.First().Title); }
public void Print_WithOneHeaderAlignmentLeft_ShouldPrintExpectedTableWithAlignmentLeft() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a", PrintableDataRowAlignment.Left).WithRow("b"); Assert.AreEqual("|a|\n|:-----|\n|b|", table.Print()); }
public void Print_WithOneHeaderAndOneDataRow_ShouldPrintExpectedTable() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a").WithRow("b"); Assert.AreEqual("|a|\n|:-----|\n|b|", table.Print()); }
public void AddRow_WithOneHeaderAndOneDataRowWithTwoHeaders_ShouldThrowIndexOutOfRangeException() { IPrintableParagraphTable table = new MarkdownTable(); table.WithHeader("a").WithRow("b", "c"); }