Describe "Invoke-CsvCleanser" {
$nl = [Environment]::NewLine
$content = 'DATE_COLUMN,DATETIME_COLUMN,TEXT_COLUMN' + $nl + '2015-05-01,2015-05-01 23:00:00.000,LOREM IPSUM' + $nl + 'NULL,NULL,NULL'
# create CSV file; populate it with data
$csv = New-item "TestDrive:\000.csv" -Type File
Set-Content $csv -Value $content
It "Should remove all instances of the word 'NULL'" {
# remove all instances of 'NULL' from CSV file
Invoke-CsvCleanser $csv -Nulls
$actual = Get-Content $csv
$expected = 'DATE_COLUMN,DATETIME_COLUMN,TEXT_COLUMN' + $nl + '2015-05-01,2015-05-01 23:00:00.000,LOREM IPSUM' + $nl + ',,'
$actual | Should Be $expected
}
}