File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 613613 Assert-MockCalled - CommandName Add-Computer - Exactly - Times 0 - Scope It - ParameterFilter { $WorkGroupName }
614614 }
615615
616+ It ' Changes ComputerName and changes Workgroup to Domain with specified Domain Controller' {
617+ Mock - CommandName Get-WMIObject - MockWith {
618+ [PSCustomObject ] @ {
619+ Domain = ' Contoso' ;
620+ Workgroup = ' Contoso' ;
621+ PartOfDomain = $false
622+ }
623+ }
624+
625+ Mock - CommandName Get-ComputerDomain - MockWith {
626+ ' '
627+ }
628+
629+ Set-TargetResource `
630+ - Name $notComputerName `
631+ - DomainName ' Contoso.com' `
632+ - Server ' dc01.contoso.com' `
633+ - Credential $credential `
634+ - Verbose | Should - BeNullOrEmpty
635+
636+ Assert-MockCalled - CommandName Rename-Computer - Exactly - Times 0 - Scope It
637+ Assert-MockCalled - CommandName Add-Computer - Exactly - Times 1 - Scope It - ParameterFilter { $DomainName -and $NewName -and $Server }
638+ Assert-MockCalled - CommandName Add-Computer - Exactly - Times 0 - Scope It - ParameterFilter { $WorkGroupName }
639+ }
640+
616641 It ' Changes ComputerName and changes Workgroup to Domain with specified OU' {
617642 Mock - CommandName Get-WMIObject - MockWith {
618643 [PSCustomObject ] @ {
@@ -1008,6 +1033,12 @@ try
10081033 Assert-MockCalled - CommandName Get-Item - Exactly - Times 0 - Scope It
10091034 }
10101035 }
1036+
1037+ Context " $ ( $script :DSCResourceName ) \Get-LogonServer" {
1038+ It ' Should return a non-empty string' {
1039+ Get-LogonServer | Should -Not - BeNullOrEmpty
1040+ }
1041+ }
10111042 }
10121043 } # end InModuleScope $DSCResourceName
10131044 # endregion
You can’t perform that action at this time.
0 commit comments