From 94d86927baf67a294e1a2f007eebc8735558e33a Mon Sep 17 00:00:00 2001 From: dfinke Date: Sun, 22 Apr 2018 14:19:58 -0400 Subject: [PATCH] Expand aliases --- ConvertFromExcelToSQLInsert.tests.ps1 | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/ConvertFromExcelToSQLInsert.tests.ps1 b/ConvertFromExcelToSQLInsert.tests.ps1 index 4d6bf37..1b6a31b 100644 --- a/ConvertFromExcelToSQLInsert.tests.ps1 +++ b/ConvertFromExcelToSQLInsert.tests.ps1 @@ -1,13 +1,11 @@ -cls - -ipmo .\ImportExcel.psd1 -Force +Import-Module .\ImportExcel.psd1 -Force $xlFile = ".\testSQL.xlsx" Describe "ConvertFrom-ExcelToSQLInsert" { - + BeforeEach { - + $([PSCustomObject]@{ Name="John" Age=$null @@ -15,22 +13,22 @@ Describe "ConvertFrom-ExcelToSQLInsert" { } 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', '');" - - $actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1 - + + $actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1 + $actual | should be $expected } - It "Should have NULL" { + It "Should have NULL" { $expected="INSERT INTO Sheet1 ('Name', 'Age') Values('John', NULL);" - + $actual = ConvertFrom-ExcelToSQLInsert -Path $xlFile Sheet1 -ConvertEmptyStringsToNull - + $actual | should be $expected } } \ No newline at end of file