diff --git a/__tests__/ImportExcelTests/ImportExcelEndRowEndColumn.tests.ps1 b/__tests__/ImportExcelTests/ImportExcelEndRowEndColumn.tests.ps1 index f9856f8..4667203 100644 --- a/__tests__/ImportExcelTests/ImportExcelEndRowEndColumn.tests.ps1 +++ b/__tests__/ImportExcelTests/ImportExcelEndRowEndColumn.tests.ps1 @@ -32,6 +32,20 @@ Describe 'Test' -Tag ImportExcelEndRowAndCols { $colNames[0] | Should -Be 'Units' $colNames[1] | Should -Be 'Price' } + + It 'Should read any row up to maximum allowed row' { + # Max Rows sheet has row number as integer in column 1. + $xlMaxRows = "$PSScriptRoot\MaxRows.xlsx" + # Construct array of ten numbers. Min (1), 8 random numbers between Min and max, Max (1048576) + $countOfTen = @(1) + $countOfTen += (Get-Random -Count 8 -InputObject (2..1048575)) | Sort-Object + $countOfTen += 1048576 + # Test these cell values. + $countOfTen | ForEach-Object { + $actual = Import-Excel $xlMaxRows -StartRow $_ -EndRow $_ -NoHeader + $actual.P1 | Should -Be $_ + } + } } Context 'Test reading multiple sheets with data in differnt rows and columns' { diff --git a/__tests__/ImportExcelTests/MaxRows.xlsx b/__tests__/ImportExcelTests/MaxRows.xlsx new file mode 100644 index 0000000..e671240 Binary files /dev/null and b/__tests__/ImportExcelTests/MaxRows.xlsx differ