diff --git a/src/pester-tests/ConvertFrom-Csv.Tests.ps1 b/src/pester-tests/ConvertFrom-Csv.Tests.ps1 new file mode 100644 index 0000000000..6fe75c18c2 --- /dev/null +++ b/src/pester-tests/ConvertFrom-Csv.Tests.ps1 @@ -0,0 +1,27 @@ +Describe "ConvertFrom-Csv" { + $testObject = "a", "1" + $testDelimiter = "a; b" + $testColumns = @" + a,b,c + 1,2,3 +"@ + It "Should be able to be called" { + { ConvertFrom-Csv -InputObject $testObject } | Should Not Throw + } + + It "Should be able to pipe" { + { $testObject | ConvertFrom-Csv } | Should Not Throw + } + + It "Should be able to set a delimiter" { + { $testDelimiter | ConvertFrom-Csv -Delimiter ";" } | Should Not Throw + } + + It "Should be able to have multiple columns" { + $actualData = $testColumns | ConvertFrom-Csv + + $actualLength = $($( $actualData | gm) | Where-Object {$_.MemberType -eq "NoteProperty" }).Length + + $actualLength | Should Be 3 + } +} \ No newline at end of file