@@ -69,9 +69,9 @@ bazz = 2
69
69
Describe " Delimiter parameter tests" - Tags " CI" {
70
70
BeforeAll {
71
71
$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' } }
75
75
)
76
76
}
77
77
89
89
{ $sampleData | ConvertFrom-StringData - Delimiter ' :' } | Should -Not - Throw
90
90
}
91
91
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 {
93
93
param ($Delimiter , $StringData , $ExpectedResult )
94
94
95
95
$Result = ConvertFrom-StringData - StringData $StringData - Delimiter $Delimiter
96
96
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
+ }
104
101
}
105
102
}
0 commit comments