Update Tests to use Variables for commandNames
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
$moduleFileName = "ZertoApiWrapper.psm1"
|
$moduleFileName = "ZertoApiWrapper.psm1"
|
||||||
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
||||||
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
||||||
|
$commandName = $fileName -replace '.ps1', ''
|
||||||
$modulePath = $filePath -replace "Public", ""
|
$modulePath = $filePath -replace "Public", ""
|
||||||
Import-Module $modulePath\$moduleFileName -Force
|
Import-Module $modulePath\$moduleFileName -Force
|
||||||
|
|
||||||
@@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us
|
|||||||
$zertoServer = "192.168.1.100"
|
$zertoServer = "192.168.1.100"
|
||||||
$zertoPort = "7669"
|
$zertoPort = "7669"
|
||||||
|
|
||||||
Describe "Add-ZertoPeerSite" {
|
Describe "$commandName" {
|
||||||
it "file should exist" {
|
it "file should exist" {
|
||||||
"$filePath\$fileName" | should exist
|
"$filePath\$fileName" | should exist
|
||||||
}
|
}
|
||||||
it "module should have a function called Add-ZertoPeerSite" {
|
it "module should have a function called $commandName" {
|
||||||
get-command Add-ZertoPeerSite | should be $true
|
get-command $commandName | should be $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
$moduleFileName = "ZertoApiWrapper.psm1"
|
$moduleFileName = "ZertoApiWrapper.psm1"
|
||||||
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
||||||
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
||||||
|
$commandName = $fileName -replace '.ps1', ''
|
||||||
$modulePath = $filePath -replace "Public", ""
|
$modulePath = $filePath -replace "Public", ""
|
||||||
Import-Module $modulePath\$moduleFileName -Force
|
Import-Module $modulePath\$moduleFileName -Force
|
||||||
|
|
||||||
@@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us
|
|||||||
$zertoServer = "192.168.1.100"
|
$zertoServer = "192.168.1.100"
|
||||||
$zertoPort = "7669"
|
$zertoPort = "7669"
|
||||||
|
|
||||||
Describe "Edit-ZertoVra" {
|
Describe "$commandName" {
|
||||||
it "file should exist" {
|
it "file should exist" {
|
||||||
"$filePath\$fileName" | should exist
|
"$filePath\$fileName" | should exist
|
||||||
}
|
}
|
||||||
it "module should have a function called Edit-ZertoVra" {
|
it "module should have a function called $commandName" {
|
||||||
get-command Edit-ZertoVra | should be $true
|
get-command $commandName | should be $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
$moduleFileName = "ZertoApiWrapper.psm1"
|
$moduleFileName = "ZertoApiWrapper.psm1"
|
||||||
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
||||||
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
||||||
|
$commandName = $fileName -replace '.ps1', ''
|
||||||
$modulePath = $filePath -replace "Public", ""
|
$modulePath = $filePath -replace "Public", ""
|
||||||
Import-Module $modulePath\$moduleFileName -Force
|
Import-Module $modulePath\$moduleFileName -Force
|
||||||
|
|
||||||
@@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us
|
|||||||
$zertoServer = "192.168.1.100"
|
$zertoServer = "192.168.1.100"
|
||||||
$zertoPort = "7669"
|
$zertoPort = "7669"
|
||||||
|
|
||||||
Describe "Set-ZertoAlert" {
|
Describe "$commandName" {
|
||||||
it "file should exist" {
|
it "file should exist" {
|
||||||
"$filePath\$fileName" | should exist
|
"$filePath\$fileName" | should exist
|
||||||
}
|
}
|
||||||
it "module should have a function called Set-ZertoAlert" {
|
it "module should have a function called $commandName" {
|
||||||
get-command Set-ZertoAlert | should be $true
|
get-command $commandName | should be $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
$moduleFileName = "ZertoApiWrapper.psm1"
|
$moduleFileName = "ZertoApiWrapper.psm1"
|
||||||
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper'
|
||||||
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.'
|
||||||
|
$commandName = $fileName -replace '.ps1', ''
|
||||||
$modulePath = $filePath -replace "Public", ""
|
$modulePath = $filePath -replace "Public", ""
|
||||||
Import-Module $modulePath\$moduleFileName -Force
|
Import-Module $modulePath\$moduleFileName -Force
|
||||||
|
|
||||||
@@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us
|
|||||||
$zertoServer = "192.168.1.100"
|
$zertoServer = "192.168.1.100"
|
||||||
$zertoPort = "7669"
|
$zertoPort = "7669"
|
||||||
|
|
||||||
Describe "Set-ZertoLicense" {
|
Describe "$commandName" {
|
||||||
it "file should exist" {
|
it "file should exist" {
|
||||||
"$filePath\$fileName" | should exist
|
"$filePath\$fileName" | should exist
|
||||||
}
|
}
|
||||||
it "module should have a function called Set-ZertoAlert" {
|
it "module should have a function called $commandName" {
|
||||||
get-command Set-ZertoLicense | should be $true
|
get-command $commandName | should be $true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user