arcus-azure / arcus.testing

Reusable testing components used during Arcus testing.
https://testing.arcus-azure.net/
MIT License
5 stars 2 forks source link

`AssertCsv`: Add support to ignore column via index when CSV Headers are missing #155

Closed ClementVaillantCodit closed 2 months ago

ClementVaillantCodit commented 2 months ago

When I use:

AssertCsv.Equal(expectedOutputFileContent, outputFileContent, opt =>
{
    opt.Separator = ';';
    opt.RowOrder = AssertCsvOrder.Ignore;
    opt.Header = AssertCsvHeader.Missing;
    opt.IgnoreColumn("DateTime");
});

then opt.IgnoreColumn("DateTime"); is useless since headers are not present in CSV.

I suggest to create a new option IgnoreColumnByIndex(2), while precising if it's 0 or 1-based index in the documentation. Using opt.IgnoreColumnByIndex(0) should not be allowed if opt.ColumnOrder is set to AssertCsvOrder.Ignore.