Added new tests for get default creds
Added test for not connected route in functions to increase coverage.
This commit is contained in:
@@ -30,6 +30,8 @@ inModuleScope VMware.VMC {
|
||||
|
||||
Mock Connect-CisServer {}
|
||||
|
||||
Mock Write-Error
|
||||
|
||||
Context "Sanity checking" {
|
||||
$command = Get-Command -Name $functionName
|
||||
|
||||
@@ -57,6 +59,11 @@ inModuleScope VMware.VMC {
|
||||
-and $User -eq $cloud_username `
|
||||
-and $Password -eq $Mockedcreds.password }
|
||||
}
|
||||
It "gets writes an error if not connected" {
|
||||
$global:DefaultVMCServers = $false
|
||||
{ Connect-VMCVIServer -org $Org -Sddc $Sddc } | 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