Skip to content

Commit

Permalink
add new mock to tests for new-user fix
Browse files Browse the repository at this point in the history
  • Loading branch information
scott1138 committed Jul 7, 2020
1 parent 963fb97 commit 581afa6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PS-Tools/tests/New-User.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ BeforeAll {
Function Connect-AzureADTenant {}
Mock Connect-AzureADTenant { $true }

# Mock needs to return an array like the real command would
Function Get-ADDomainController {}
Mock Get-ADDomainController { New-Object -TypeName psobject -Property @{Hostname = @('some-dc.domain.local')} }

# Mock needs to return $true because the result is used as a condition
Function New-ADUser {} #[CmdletBinding(SupportsShouldProcess = $True)]param([object]$object)}
Mock New-ADUser { $true }
Expand Down

0 comments on commit 581afa6

Please sign in to comment.