First pass. All code must be in a script block

This commit is contained in:
dfinke
2020-10-31 17:47:07 -04:00
parent 113bf2c95c
commit 6149442bc0
12 changed files with 911 additions and 839 deletions

View File

@@ -14,25 +14,25 @@
$actual.Count | Should -Be 1
}
It "Should read with pwd".PadRight(90){
It "Should read with pwd".PadRight(90) {
$actual = Import-Excel -Path (Join-Path $PWD "$($script:xlfileName)")
$actual | Should -Not -Be $null
}
It "Should read with just a file name and resolve to cwd".PadRight(90){
It "Should read with just a file name and resolve to cwd".PadRight(90) {
$actual = Import-Excel -Path "$($script:xlfileName)"
$actual | Should -Not -Be $null
}
It "Should fail for not found".PadRight(90){
It "Should fail for not found".PadRight(90) {
{ Import-Excel -Path "ExcelFileDoesNotExist.xlsx" } | Should -Throw "'ExcelFileDoesNotExist.xlsx' file not found"
}
It "Should fail for xls extension".PadRight(90){
It "Should fail for xls extension".PadRight(90) {
{ Import-Excel -Path "ExcelFileDoesNotExist.xls" } | Should -Throw "Import-Excel does not support reading this extension type .xls"
}
It "Should fail for xlsxs extension".PadRight(90){
It "Should fail for xlsxs extension".PadRight(90) {
{ Import-Excel -Path "ExcelFileDoesNotExist.xlsxs" } | Should -Throw "Import-Excel does not support reading this extension type .xlsxs"
}
}