mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-11 22:03:29 +00:00
Merge pull request #711 from uSlackr/patch-2
Adding test for Get-ColumnName for https://github.com/dfinke/ImportExcel/issues/708
This commit is contained in:
32
__tests__/Get-ExcelColumnName.Test.ps1
Normal file
32
__tests__/Get-ExcelColumnName.Test.ps1
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
#Requires -Modules Pester
|
||||||
|
#Import-Module $PSScriptRoot\..\ImportExcel.psd1 -Force
|
||||||
|
|
||||||
|
$map = @{
|
||||||
|
1024 = 'AMJ'
|
||||||
|
2048 = 'BZT'
|
||||||
|
3072 = 'DND'
|
||||||
|
4096 = 'FAN'
|
||||||
|
5120 = 'GNX'
|
||||||
|
6144 = 'IBH'
|
||||||
|
7168 = 'JOR'
|
||||||
|
8192 = 'LCB'
|
||||||
|
9216 = 'MPL'
|
||||||
|
10240 = 'OCV'
|
||||||
|
11264 = 'PQF'
|
||||||
|
12288 = 'RDP'
|
||||||
|
13312 = 'SQZ'
|
||||||
|
14336 = 'UEJ'
|
||||||
|
15360 = 'VRT'
|
||||||
|
16384 = 'XFD'
|
||||||
|
}
|
||||||
|
|
||||||
|
(Get-ExcelColumnName 26).columnName |Should be 'Z'
|
||||||
|
(Get-ExcelColumnName 27).columnName |Should be 'AA'
|
||||||
|
(Get-ExcelColumnName 28).columnNamee |Should be 'AB'
|
||||||
|
(Get-ExcelColumnName 30).columnName |Should be 'AD'
|
||||||
|
(Get-ExcelColumnName 48).columnName |Should be 'AV'
|
||||||
|
|
||||||
|
1..16 | % {
|
||||||
|
$number = $_*1024
|
||||||
|
(Get-ExcelColumnName $number).columnName |Should be $map.$number
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user