|
1 | | -[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] |
| 1 | +[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] |
2 | 2 | param () |
3 | 3 |
|
4 | 4 | Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath 'TestHelpers') -ChildPath 'CommonTestHelper.psm1') |
@@ -87,26 +87,26 @@ Setting3.Test=Value4 |
87 | 87 | -ConfigurationData $configData |
88 | 88 |
|
89 | 89 | Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose |
90 | | - } | Should Not Throw |
| 90 | + } | Should -Not -Throw |
91 | 91 | } |
92 | 92 |
|
93 | 93 | It 'Should be able to call Get-DscConfiguration without throwing' { |
94 | | - { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw |
| 94 | + { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw |
95 | 95 | } |
96 | 96 |
|
97 | 97 | It 'Should have set the resource and all the parameters should match' { |
98 | 98 | $script:current = $script:currentDscConfig | Where-Object { |
99 | 99 | $_.ConfigurationName -eq $script:configurationName |
100 | 100 | } |
101 | | - $current.Path | Should Be $script:testTextFile |
102 | | - $current.Name | Should Be $script:testName |
103 | | - $current.Ensure | Should Be 'Present' |
104 | | - $current.Type | Should Be 'Text' |
105 | | - $current.Text | Should Be "$($script:testText),$($script:testText),$($script:testText)" |
| 101 | + $current.Path | Should -Be $script:testTextFile |
| 102 | + $current.Name | Should -Be $script:testName |
| 103 | + $current.Ensure | Should -Be 'Present' |
| 104 | + $current.Type | Should -Be 'Text' |
| 105 | + $current.Text | Should -Be "$($script:testText),$($script:testText),$($script:testText)" |
106 | 106 | } |
107 | 107 |
|
108 | 108 | It 'Should be convert the file content to match expected content' { |
109 | | - Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedTextContent |
| 109 | + Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedTextContent |
110 | 110 | } |
111 | 111 |
|
112 | 112 | AfterAll { |
@@ -149,26 +149,26 @@ Setting3.Test=Value4 |
149 | 149 | -ConfigurationData $configData |
150 | 150 |
|
151 | 151 | Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose |
152 | | - } | Should Not Throw |
| 152 | + } | Should -Not -Throw |
153 | 153 | } |
154 | 154 |
|
155 | 155 | It 'Should be able to call Get-DscConfiguration without throwing' { |
156 | | - { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw |
| 156 | + { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw |
157 | 157 | } |
158 | 158 |
|
159 | 159 | It 'Should have set the resource and all the parameters should match' { |
160 | 160 | $script:current = $script:currentDscConfig | Where-Object { |
161 | 161 | $_.ConfigurationName -eq $script:configurationName |
162 | 162 | } |
163 | | - $current.Path | Should Be $script:testTextFile |
164 | | - $current.Name | Should Be $script:testName |
165 | | - $current.Ensure | Should Be 'Present' |
166 | | - $current.Type | Should Be 'Text' |
167 | | - $current.Text | Should Be "$($script:testSecret),$($script:testSecret),$($script:testSecret)" |
| 163 | + $current.Path | Should -Be $script:testTextFile |
| 164 | + $current.Name | Should -Be $script:testName |
| 165 | + $current.Ensure | Should -Be 'Present' |
| 166 | + $current.Type | Should -Be 'Text' |
| 167 | + $current.Text | Should -Be "$($script:testSecret),$($script:testSecret),$($script:testSecret)" |
168 | 168 | } |
169 | 169 |
|
170 | 170 | It 'Should be convert the file content to match expected content' { |
171 | | - Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedSecretContent |
| 171 | + Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedSecretContent |
172 | 172 | } |
173 | 173 |
|
174 | 174 | AfterAll { |
@@ -208,26 +208,26 @@ Setting3.Test=Value4 |
208 | 208 | -ConfigurationData $configData |
209 | 209 |
|
210 | 210 | Start-DscConfiguration -Path $TestDrive -ErrorAction 'Stop' -Wait -Force -Verbose |
211 | | - } | Should Not Throw |
| 211 | + } | Should -Not -Throw |
212 | 212 | } |
213 | 213 |
|
214 | 214 | It 'Should be able to call Get-DscConfiguration without throwing' { |
215 | | - { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should Not throw |
| 215 | + { $script:currentDscConfig = Get-DscConfiguration -Verbose -ErrorAction Stop } | Should -Not -throw |
216 | 216 | } |
217 | 217 |
|
218 | 218 | It 'Should have set the resource and all the parameters should match' { |
219 | 219 | $script:current = $script:currentDscConfig | Where-Object { |
220 | 220 | $_.ConfigurationName -eq $script:configurationName |
221 | 221 | } |
222 | | - $current.Path | Should Be $script:testTextFile |
223 | | - $current.Name | Should Be $script:testName |
224 | | - $current.Ensure | Should Be 'Absent' |
225 | | - $current.Type | Should Be 'Text' |
226 | | - $current.Text | Should BeNullOrEmpty |
| 222 | + $current.Path | Should -Be $script:testTextFile |
| 223 | + $current.Name | Should -Be $script:testName |
| 224 | + $current.Ensure | Should -Be 'Absent' |
| 225 | + $current.Type | Should -Be 'Text' |
| 226 | + $current.Text | Should -BeNullOrEmpty |
227 | 227 | } |
228 | 228 |
|
229 | 229 | It 'Should be convert the file content to match expected content' { |
230 | | - Get-Content -Path $script:testTextFile -Raw | Should Be $script:testFileExpectedAbsentContent |
| 230 | + Get-Content -Path $script:testTextFile -Raw | Should -Be $script:testFileExpectedAbsentContent |
231 | 231 | } |
232 | 232 |
|
233 | 233 | AfterAll { |
|
0 commit comments