Skip to content

Commit 59ef06e

Browse files
committed
Fix
1 parent 390c218 commit 59ef06e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Tests/Unit/MSFT_xComputer.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ try
286286
}
287287
It 'Changes computer description in a workgroup'{
288288
Mock Get-ComputerDomain {''}
289-
Mock Get-WMIObject {[PSCustomObject]@{Workgroup='Contoso';PartOfDomain=$false}}
290-
Set-TargetResource -Name $env:COMPUTERNAME -WorkGroupName 'Contoso' -Description = 'This is my computer' | Should BeNullOrEmpty
289+
Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso';Workgroup='Contoso';PartOfDomain=$false}}
290+
Set-TargetResource -Name $env:COMPUTERNAME -Description = 'This is my computer' | Should BeNullOrEmpty
291291
Assert-MockCalled -CommandName Set-CimInstance -Exactly 1 -Scope It
292292
}
293293
It 'Changes computer description in a domain'{
294294
Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}}
295295
Mock Get-ComputerDomain {'contoso.com'}
296296
Set-TargetResource -Name $Env:ComputerName | Should BeNullOrEmpty
297297
Set-TargetResource -Name $env:COMPUTERNAME -DomainName 'Contoso.com' -Credential $Credential -UnjoinCredential $Credential -Description = 'This is my computer' | Should BeNullOrEmpty
298-
Assert-MockCalled -CommandName Set-CimInstance -Exactly 1 -Scope It
298+
Assert-MockCalled -CommandName Set-CimInstance -Exactly 2 -Scope It
299299
}
300300
}
301301
}

0 commit comments

Comments
 (0)