Add fix to avoid exception on Rows with no children

This commit is contained in:
Jeppe Roi Kristensen
2023-06-12 21:03:13 +02:00
committed by Patrik Svensson
parent d484e832f5
commit e0ded712e8
4 changed files with 37 additions and 4 deletions

View File

@ -50,6 +50,25 @@ public sealed class RowsTests
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_Empty")]
public Task Should_Not_Throw_Exception_On_Empty_Rows()
{
// Given
var console = new TestConsole().Width(60);
var table = new Table()
.AddColumns("Foo", "Bar")
.AddRow("HELLO WORLD")
.AddRow(
new Rows(), new Text("Qux"));
// When
console.Write(table);
// Then
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_Expanded_And_Nested")]
public Task Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded()