@@ -69,9 +69,9 @@ bazz = 2
6969Describe " Delimiter parameter tests" - Tags " CI" {
7070 BeforeAll {
7171 $TestCases = @ (
72- @ { Delimiter = ' :' ; StringData = ' value:10' ; ExpectedResult = @ { value = 10 } }
73- @ { Delimiter = ' -' ; StringData = ' a-b' ; ExpectedResult = @ { a = ' b' } }
74- @ { Delimiter = ' ,' ; StringData = ' c,d' ; ExpectedResult = @ { c = ' d' } }
72+ @ { Delimiter = ' :' ; StringData = ' value:10' ; ExpectedResult = @ { Values = 10 } }
73+ @ { Delimiter = ' -' ; StringData = ' a-b' ; ExpectedResult = @ { Values = ' b' } }
74+ @ { Delimiter = ' ,' ; StringData = ' c,d' ; ExpectedResult = @ { Values = ' d' } }
7575 )
7676 }
7777
8989 { $sampleData | ConvertFrom-StringData - Delimiter ' :' } | Should -Not - Throw
9090 }
9191
92- It ' is able to parse <StringData> with delimiter "<Delimiter> with <stringdata> "' - TestCases $TestCases {
92+ It ' is able to parse <StringData> with delimiter "<Delimiter>"' - TestCases $TestCases {
9393 param ($Delimiter , $StringData , $ExpectedResult )
9494
9595 $Result = ConvertFrom-StringData - StringData $StringData - Delimiter $Delimiter
9696
97- $key = $ExpectedResult.Keys
98-
99- # validate the key in expected and result hashtables match
100- $Result.Keys | Should - BeExactly $ExpectedResult.Keys
101-
102- # validate the values in expected and result hashtables match
103- $Result [$key ] | Should - BeExactly $ExpectedResult.Values
97+ foreach ($Key in $ExpectedResult.Keys ) {
98+ $Key | Should - BeIn $ExpectedResult.Keys
99+ $Result .$Key | Should - Be $ExpectedResult .$Key
100+ }
104101 }
105102}
0 commit comments