Add option to show separator between table rows (#1304)

* Add option to show separator between table rows
* Panels should show header if borders are not shown

Closes #835
This commit is contained in:
Patrik Svensson
2023-09-16 18:49:12 +02:00
committed by GitHub
parent 037e109699
commit c82d8c4523
33 changed files with 272 additions and 43 deletions

View File

@ -0,0 +1,7 @@
┌────────┬────────┬───────┐
│ Foo │ Bar │ Baz │
├────────┼────────┼───────┤
│ Qux │ Corgi │ Waldo │
├────────┼────────┼───────┤
│ Grault │ Garply │ Fred │
└────────┴────────┴───────┘

View File

@ -23,6 +23,22 @@ public sealed class BoxBorderTests
[Fact]
[Expectation("NoBorder")]
public Task Should_Render_As_Expected()
{
// Given
var console = new TestConsole();
var panel = Fixture.GetPanel().NoBorder();
panel.Header = null;
// When
console.Write(panel);
// Then
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("NoBorder_With_Header")]
public Task Should_Render_NoBorder_With_Header_As_Expected()
{
// Given
var console = new TestConsole();

View File

@ -142,6 +142,25 @@ public sealed class TableTests
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_Row_Separators")]
public Task Should_Render_Table_With_Row_Separators_Correctly()
{
// Given
var console = new TestConsole();
var table = new Table();
table.ShowRowSeparators();
table.AddColumns("Foo", "Bar", "Baz");
table.AddRow("Qux", "Corgi", "Waldo");
table.AddRow("Grault", "Garply", "Fred");
// When
console.Write(table);
// Then
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_EA_Character")]
public Task Should_Render_Table_With_EA_Character_Correctly()