mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
added ConvertFrom-Csv tests
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user