mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-01-11 04:53:17 +00:00
Add helper method
This commit is contained in:
20
__tests__/Read-OleDbDataTests/Read-XlsxUsingOleDb.Tests..ps1
Normal file
20
__tests__/Read-OleDbDataTests/Read-XlsxUsingOleDb.Tests..ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
#Requires -Modules Pester
|
||||
$scriptPath = $PSScriptRoot
|
||||
Import-Module $scriptPath\..\..\ImportExcel.psd1 -Force
|
||||
$tfp = "$scriptPath\Read-OleDbData.xlsx"
|
||||
$ACEnotWorking = $false
|
||||
try {
|
||||
$Results = Read-XlsxUsingOleDb $tfp "select 1"
|
||||
}
|
||||
catch {
|
||||
$ACEnotWorking = $true
|
||||
}
|
||||
Describe "Read-XlsxUsingOleDb" -Tag "Read-XlsxUsingOleDb" {
|
||||
$PSDefaultParameterValues = @{ 'It:Skip' = $ACEnotWorking }
|
||||
Context "Sheet1`$A1" {
|
||||
It "Should return 1 result with a value of 1" {
|
||||
$Results = Read-XlsxUsingOleDb $tfp "select ROUND(F1) as [A1] from [sheet1`$A1:A1]"
|
||||
@($Results).length + $Results.A1 | Should -Be 2
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user