Skip to content

Commit 390c218

Browse files
committed
Added Mock Set-CimInstance
1 parent 1ded622 commit 390c218

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tests/Unit/MSFT_xComputer.Tests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ try
151151
Context "$($Global:DSCResourceName)\Set-TargetResource" {
152152
Mock Rename-Computer {}
153153
Mock Add-Computer {}
154+
Mock Set-CimInstance {}
154155
It 'Throws if both DomainName and WorkGroupName are specified' {
155156
{Set-TargetResource -Name $Env:ComputerName -DomainName 'contoso.com' -WorkGroupName 'workgroup'} | Should Throw
156157
Assert-MockCalled -CommandName Rename-Computer -Exactly 0 -Scope It
@@ -285,7 +286,7 @@ try
285286
}
286287
It 'Changes computer description in a workgroup'{
287288
Mock Get-ComputerDomain {''}
288-
Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso';Workgroup='Contoso';PartOfDomain=$false}}
289+
Mock Get-WMIObject {[PSCustomObject]@{Workgroup='Contoso';PartOfDomain=$false}}
289290
Set-TargetResource -Name $env:COMPUTERNAME -WorkGroupName 'Contoso' -Description = 'This is my computer' | Should BeNullOrEmpty
290291
Assert-MockCalled -CommandName Set-CimInstance -Exactly 1 -Scope It
291292
}

0 commit comments

Comments
 (0)