File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 128128 }
129129 It ' Should return false if description is same as specified' {
130130 Mock Get-CimInstance {[PSCustomObject ]@ {Description = ' This is not my computer' }}
131- Test-TargetResource - Name $env: COMPUTERNAME - Description " This is my computer" | Should Be $true
132- Test-TargetResource - Name ' localhost' - Description " This is my computer" | Should Be $true
131+ Test-TargetResource - Name $env: COMPUTERNAME - Description " This is my computer" | Should Be $false
132+ Test-TargetResource - Name ' localhost' - Description " This is my computer" | Should Be $false
133133 }
134134 }
135135 Context " $ ( $Global :DSCResourceName ) \Get-TargetResource" {
284284 {Set-TargetResource - Name " ThisIsBad<>" } | Should Throw
285285 }
286286 It ' Changes computer description' {
287- # Mock Get-CimInstance {[PSCustomObject]@{Description = 'This is not my computer' }}
287+ Mock Get-WMIObject {[PSCustomObject ]@ {Domain = ' Contoso ' ; Workgroup = ' Contoso ' ; PartOfDomain = $false }}
288288 Set-TargetResource - Name $env: COMPUTERNAME - Description = ' This is my computer'
289289 Assert-MockCalled - CommandName Set-CimInstance - Exactly 1 - Scope It
290290 }
You can’t perform that action at this time.
0 commit comments