diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 06aa6f8..2d8dbc5 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,7 @@ $moduleFileName = "ZertoApiWrapper.psm1" $filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' $fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$commandName = $fileName -replace '.ps1', '' $modulePath = $filePath -replace "Public", "" Import-Module $modulePath\$moduleFileName -Force @@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us $zertoServer = "192.168.1.100" $zertoPort = "7669" -Describe "Add-ZertoPeerSite" { +Describe "$commandName" { it "file should exist" { "$filePath\$fileName" | should exist } - it "module should have a function called Add-ZertoPeerSite" { - get-command Add-ZertoPeerSite | should be $true + it "module should have a function called $commandName" { + get-command $commandName | should be $true } } \ No newline at end of file diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 943079d..2d8dbc5 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -1,6 +1,7 @@ $moduleFileName = "ZertoApiWrapper.psm1" $filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' $fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$commandName = $fileName -replace '.ps1', '' $modulePath = $filePath -replace "Public", "" Import-Module $modulePath\$moduleFileName -Force @@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us $zertoServer = "192.168.1.100" $zertoPort = "7669" -Describe "Edit-ZertoVra" { +Describe "$commandName" { it "file should exist" { "$filePath\$fileName" | should exist } - it "module should have a function called Edit-ZertoVra" { - get-command Edit-ZertoVra | should be $true + it "module should have a function called $commandName" { + get-command $commandName | should be $true } -} +} \ No newline at end of file diff --git a/Tests/Public/Set-ZertoAlert.Tests.ps1 b/Tests/Public/Set-ZertoAlert.Tests.ps1 index 8f440fa..2d8dbc5 100644 --- a/Tests/Public/Set-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Set-ZertoAlert.Tests.ps1 @@ -1,6 +1,7 @@ $moduleFileName = "ZertoApiWrapper.psm1" $filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' $fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$commandName = $fileName -replace '.ps1', '' $modulePath = $filePath -replace "Public", "" Import-Module $modulePath\$moduleFileName -Force @@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us $zertoServer = "192.168.1.100" $zertoPort = "7669" -Describe "Set-ZertoAlert" { +Describe "$commandName" { it "file should exist" { "$filePath\$fileName" | should exist } - it "module should have a function called Set-ZertoAlert" { - get-command Set-ZertoAlert | should be $true + it "module should have a function called $commandName" { + get-command $commandName | should be $true } } \ No newline at end of file diff --git a/Tests/Public/Set-ZertoLicense.Tests.ps1 b/Tests/Public/Set-ZertoLicense.Tests.ps1 index fbdb17a..2d8dbc5 100644 --- a/Tests/Public/Set-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Set-ZertoLicense.Tests.ps1 @@ -1,6 +1,7 @@ $moduleFileName = "ZertoApiWrapper.psm1" $filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' $fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$commandName = $fileName -replace '.ps1', '' $modulePath = $filePath -replace "Public", "" Import-Module $modulePath\$moduleFileName -Force @@ -12,11 +13,11 @@ $credential = New-Object -TypeName System.Management.Automation.PSCredential($us $zertoServer = "192.168.1.100" $zertoPort = "7669" -Describe "Set-ZertoLicense" { +Describe "$commandName" { it "file should exist" { "$filePath\$fileName" | should exist } - it "module should have a function called Set-ZertoAlert" { - get-command Set-ZertoLicense | should be $true + it "module should have a function called $commandName" { + get-command $commandName | should be $true } } \ No newline at end of file