Wraped all the tests inModuleScope for invoke-pester invocation.
Moved function name into module scope.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#Requires -Modules Pester, VMware.VMC
|
||||
$functionName = $MyInvocation.MyCommand.Name.TrimEnd(".Tests.ps1")
|
||||
|
||||
inModuleScope VMware.VMC {
|
||||
$functionName = "Connect-VMCVIServer"
|
||||
Describe "$functionName" -Tag 'Unit' {
|
||||
. "$PSScriptRoot/Shared.ps1"
|
||||
|
||||
@@ -57,3 +59,4 @@ Describe "$functionName" -Tag 'Unit' {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
#Requires -Modules Pester, VMware.VMC, VMware.VimAutomation.Vmc
|
||||
$functionName = $MyInvocation.MyCommand.Name.TrimEnd(".Tests.ps1")
|
||||
|
||||
|
||||
inModuleScope VMware.VMC {
|
||||
$functionName = "Get-VMCCommand"
|
||||
Describe "$functionName" -Tag 'Unit' {
|
||||
Mock Get-Command {
|
||||
"Mocked Command Response"
|
||||
@@ -18,3 +20,4 @@ Describe "$functionName" -Tag 'Unit' {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
#Requires -Modules Pester, VMware.VMC
|
||||
$functionName = $MyInvocation.MyCommand.Name.TrimEnd(".Tests.ps1")
|
||||
Import-Module -Name VMware.VimAutomation.Cis.Core
|
||||
|
||||
inModuleScope VMware.VMC {
|
||||
$functionName = "Get-VMCOrg"
|
||||
Describe "$functionName" -Tag 'Unit' {
|
||||
. "$PSScriptRoot/Shared.ps1"
|
||||
|
||||
@@ -71,3 +72,4 @@ Describe "$functionName" -Tag 'Unit' {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
#Requires -Modules Pester, VMware.VMC
|
||||
$functionName = $MyInvocation.MyCommand.Name.TrimEnd(".Tests.ps1")
|
||||
Import-Module -Name VMware.VimAutomation.Cis.Core
|
||||
|
||||
inModuleScope VMware.VMC {
|
||||
$functionName ="Get-VmcSddc"
|
||||
Describe "$functionName" -Tag 'Unit' {
|
||||
. "$PSScriptRoot/Shared.ps1"
|
||||
|
||||
@@ -78,3 +79,4 @@ Describe "$functionName" -Tag 'Unit' {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
#Requires -Modules Pester, VMware.VMC
|
||||
$functionName = $MyInvocation.MyCommand.Name.TrimEnd(".Tests.ps1")
|
||||
Import-Module -Name VMware.VimAutomation.Cis.Core
|
||||
|
||||
inModuleScope VMware.VMC {
|
||||
$functionName = "Get-VMCTask"
|
||||
Describe "$functionName" -Tag 'Unit' {
|
||||
. "$PSScriptRoot/Shared.ps1"
|
||||
|
||||
@@ -76,3 +77,4 @@ Describe "$functionName" -Tag 'Unit' {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user