mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-11 13:53:20 +00:00
Expand aliases
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
cls
|
Import-Module .\ImportExcel.psd1 -Force
|
||||||
|
|
||||||
ipmo .\ImportExcel.psd1 -Force
|
|
||||||
|
|
||||||
$xlFile = ".\testSQL.xlsx"
|
$xlFile = ".\testSQL.xlsx"
|
||||||
|
|
||||||
Describe "ConvertFrom-ExcelToSQLInsert" {
|
Describe "ConvertFrom-ExcelToSQLInsert" {
|
||||||
|
|
||||||
BeforeEach {
|
BeforeEach {
|
||||||
|
|
||||||
$([PSCustomObject]@{
|
$([PSCustomObject]@{
|
||||||
Name="John"
|
Name="John"
|
||||||
Age=$null
|
Age=$null
|
||||||
@@ -15,22 +13,22 @@ Describe "ConvertFrom-ExcelToSQLInsert" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AfterAll {
|
AfterAll {
|
||||||
rm $xlFile -Recurse -Force -ErrorAction Ignore
|
Remove-Item $xlFile -Recurse -Force -ErrorAction Ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should be empty double single quotes" {
|
It "Should be empty double single quotes" {
|
||||||
$expected="INSERT INTO Sheet1 ('Name', 'Age') Values('John', '');"
|
$expected="INSERT INTO Sheet1 ('Name', 'Age') Values('John', '');"
|
||||||
|
|
||||||
$actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1
|
$actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1
|
||||||
|
|
||||||
$actual | should be $expected
|
$actual | should be $expected
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Should have NULL" {
|
It "Should have NULL" {
|
||||||
$expected="INSERT INTO Sheet1 ('Name', 'Age') Values('John', NULL);"
|
$expected="INSERT INTO Sheet1 ('Name', 'Age') Values('John', NULL);"
|
||||||
|
|
||||||
$actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1 -ConvertEmptyStringsToNull
|
$actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1 -ConvertEmptyStringsToNull
|
||||||
|
|
||||||
$actual | should be $expected
|
$actual | should be $expected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user