mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Add Unit Test for ConvertFrom-StringData
This commit is contained in:
1 parent
8718d9f6a8
commit
e3603e3bf3
1 file changed
+20
@@ -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
|
||||
|
||||
Reference in new issue
Block a user