diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 39873fd..8f3c29b 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -49,4 +49,3 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Remove-Variable -Name here -Scope Global Remove-Variable -Name function -Scope Global - diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 294021f..46c470b 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -1,24 +1,21 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Context "$global:function::Parameter Unit Tests" { + + It "has a non-mandatory string parameter for the datacenterIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + } } - It "has a non-mandatory string parameter for the datacenterIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + Context "$global:function::Parameter Functional Tests" { + } -} \ No newline at end of file +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global