Added new tests for get default creds
Added test for not connected route in functions to increase coverage.
This commit is contained in:
@@ -32,6 +32,8 @@ inModuleScope VMware.VMC {
|
||||
|
||||
Mock -CommandName Get-VMCOrg { $object }
|
||||
|
||||
Mock -CommandName Write-Error -MockWith {}
|
||||
|
||||
Context "Sanity checking" {
|
||||
$command = Get-Command -Name $functionName
|
||||
|
||||
@@ -75,6 +77,11 @@ inModuleScope VMware.VMC {
|
||||
$(Get-VMCTask -Org $OrgId)[0].name | Should -be $name
|
||||
$(Get-VMCTask -Org $OrgId)[1].name | Should -be $Notname
|
||||
}
|
||||
It "gets writes an error if not connected" {
|
||||
$global:DefaultVMCServers = $false
|
||||
{ Get-VMCTask -Org $OrgId } | Should Not Throw
|
||||
Assert-MockCalled -CommandName Write-Error -Times 1 -Scope It -ParameterFilter { $org -eq $Org -and $Sddc -eq $Sddc }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user