Make Headers and Rows public properties with cache clearing, add AddRows method#14
Conversation
…ows method, and add unit tests Co-authored-by: BrunoVT1992 <8803153+BrunoVT1992@users.noreply.github.com>
ConsoleTable.Text/Table.cs
Outdated
| { | ||
| private string[] _headers; | ||
| /// <summary> | ||
| /// Gets or sets the headers of the table |
| /// </summary> | ||
| public Table AddRows(params string[][] rows) | ||
| { | ||
| if (rows != null) |
BrunoVT1992
left a comment
There was a problem hiding this comment.
Use the ToTable method in all the unit tests instead of the .ToString
…use ToTable() in tests Co-authored-by: BrunoVT1992 <8803153+BrunoVT1992@users.noreply.github.com>
Updated all unit tests to use |
ConsoleTable.Text/Table.cs
Outdated
| /// </summary> | ||
| public Table AddRows(params string[][] rows) | ||
| { | ||
| if (rows?.Any() == true) |
BrunoVT1992
left a comment
There was a problem hiding this comment.
Add 1 simple unit test for ToString.
In the AddRow method check if _rows is null init the list.
Co-authored-by: BrunoVT1992 <8803153+BrunoVT1992@users.noreply.github.com>
Co-authored-by: BrunoVT1992 <8803153+BrunoVT1992@users.noreply.github.com>
Added a simple |
BrunoVT1992
left a comment
There was a problem hiding this comment.
Check and rename each unit test name. According to the functions bwing trsted .
…oTable_) Co-authored-by: BrunoVT1992 <8803153+BrunoVT1992@users.noreply.github.com>
Renamed unit test methods that were calling |
Headersproperty public with private backing field_headersand setter that clears cacheRowsproperty public with private backing field_rowsand setter that clears cacheAddRowsmethod that allows adding multiple rows at onceHeadersproperty (5 tests)Rowsproperty (5 tests)AddRowsmethod (5 tests)ToTable()instead ofToString()?.Any()check)_rowsin AddRow methodOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.