Merge pull request #955 from PowerShell/ConvertFromStringDataTest

Add Unit Test for ConvertFrom-StringData
This commit is contained in:
Andy Schwartzmeyer
2016-05-06 10:02:23 -07:00
@@ -1,3 +1,23 @@
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags DRT {
It "Should able to throw error when convert invalid line" {
$str =@"
#comments here
abc
#comments here
def=content of def
"@
try
{
ConvertFrom-StringData $str
Throw "we expect 'InvalidOperation' exception"
}
catch
{
$_.FullyQualifiedErrorId | Should be "InvalidOperation,Microsoft.PowerShell.Commands.ConvertFromStringDataCommand"
}
}
}
Describe "ConvertFrom-StringData" {
$sampleData = @'
foo = 0