There is a bug in the ClosedXML.Excel.IXLRow.Cell() function.
I open a workbook and access a worksheet. The worksheet has only one row, so row.Rownumber returns 1.
I access the second row of the sheet with worksheet.Row(2). Now lastUsedRow-Rownumber is 2.
Accessing row.Cell(1) returns the value of the first row's first cell.
I think in this case an exception should be thrown like NoExistingCell instead of returning the value from a different row.
Documentation says "Gets the cell in the specified column.". But what about the specified row?
It does not say "returns the cell form he specified column in the last used row."
This bug makes comparing two Excel-Files really difficult.
Dont know the algorithm, but accessing a not existing cell shoult throw an error.
Attached the Excel-Rows and visual studio immediate-output.
Comments: So let me get this straight: I give closedxml some input, I try to access row two and get result from row 1. It seems to me that there are some unit test missing. As you may know: unittests give garbage imput, so you can check yor code. It seems to me I could write some unittests which would fail. Unittest fails = bug. I am an ISTQB certified tester, so I would say its a bug.
I open a workbook and access a worksheet. The worksheet has only one row, so row.Rownumber returns 1.
I access the second row of the sheet with worksheet.Row(2). Now lastUsedRow-Rownumber is 2.
Accessing row.Cell(1) returns the value of the first row's first cell.
I think in this case an exception should be thrown like NoExistingCell instead of returning the value from a different row.
Documentation says "Gets the cell in the specified column.". But what about the specified row?
It does not say "returns the cell form he specified column in the last used row."
This bug makes comparing two Excel-Files really difficult.
Dont know the algorithm, but accessing a not existing cell shoult throw an error.
Attached the Excel-Rows and visual studio immediate-output.
Comments: So let me get this straight: I give closedxml some input, I try to access row two and get result from row 1. It seems to me that there are some unit test missing. As you may know: unittests give garbage imput, so you can check yor code. It seems to me I could write some unittests which would fail. Unittest fails = bug. I am an ISTQB certified tester, so I would say its a bug.