Add support for showing no border

This commit is contained in:
Patrik Svensson
2020-08-04 23:20:52 +02:00
committed by Patrik Svensson
parent a068fc68c3
commit f9bd936254
7 changed files with 128 additions and 62 deletions

View File

@ -111,7 +111,7 @@ namespace Spectre.Console.Tests.Unit.Composition
}
[Fact]
public void Should_Render_Table_With_Specified_Border()
public void Should_Render_Table_With_Specified_Border_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@ -132,6 +132,26 @@ namespace Spectre.Console.Tests.Unit.Composition
console.Lines[5].ShouldBe("+-------------------------+");
}
[Fact]
public void Should_Render_Table_With_No_Border_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
var table = new Table(BorderKind.None);
table.AddColumns("Foo", "Bar", "Baz");
table.AddRow("Qux", "Corgi", "Waldo");
table.AddRow("Grault", "Garply", "Fred");
// When
console.Render(table);
// Then
console.Lines.Count.ShouldBe(3);
console.Lines[0].ShouldBe("Foo Bar Baz ");
console.Lines[1].ShouldBe("Qux Corgi Waldo");
console.Lines[2].ShouldBe("Grault Garply Fred ");
}
[Fact]
public void Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly()
{