2 changed files
Tests | ||
Common | ||
000-Module.Tests.ps1 | ||
Unit | ||
Connection.Tests.ps1 rename | ||
Add comment 1 Minus $ProjectRoot = $env:BHProjectPath
Add comment 2 Minus $ModuleRoot = $env:BHModulePath
Add comment 3 Minus $ModuleName = $env:BHProjectName
Add comment 4 Minus $ModulePath = $env:BHPSModuleManifest
Add comment 5 Minus Import-Module $ModulePath -Force
Add comment 6 Minus
Add comment 7 Minus Describe "Module Tests for $ModuleName" {
Add comment 8 Minus It 'Passes Test-ModuleManifest' {
Add comment 9 Minus { $Result = Test-ModuleManifest -Path $ModulePath -ErrorAction Stop } | Should Not Throw
Add comment 10 Minus }
Add comment 11 Minus
Add comment 12 Minus It "Can import the Module" {
Add comment 13 Minus $Module = Import-Module $ModulePath -Force -PassThru | Where-Object {$_.Name -eq $ModuleName}
Add comment 14 Minus $Module.Name | Should be $ModuleName
Add comment 15 Minus }
Add comment 16 Minus }
Add comment 17 Minus
Add comment 18 Minus Describe "Comment-based help for $ModuleName" {
Add comment 19 Minus
Add comment 20 Minus $Functions = Get-Command -Module $ModuleName -CommandType Function
Add comment 21 Minus
Add comment 22 Minus foreach ($Func in $Functions) {
Add comment 23 Minus $Help = Get-Help $Func.Name
Add comment 24 Minus
Add comment 25 Minus Context $Help.Name {
Add comment 26 Minus it "Has Synopsis" {
Add comment 27 Minus $Help.Synopsis | Should Not BeNullOrEmpty
Add comment 28 Minus }
Add comment 29 Minus
Add comment 30 Minus it "Has Description" {
Add comment 31 Minus $Help.Description | Should Not BeNullOrEmpty
Add comment 32 Minus }
Add comment 33 Minus
Add comment 34 Minus foreach ($Parameter in $Help.Parameters.Parameter) {
Add comment 35 Minus if ($Parameter -notmatch 'whatif|confirm') {
Add comment 36 Minus it "Has a Parameter description for '$($Parameter.Name)'" {
Add comment 37 Minus $Parameter.Description.Text | Should Not BeNullOrEmpty
Add comment 38 Minus }
Add comment 39 Minus }
Add comment 40 Minus }
Add comment 41 Minus
Add comment 42 Minus it "Has Examples" {
Add comment 43 Minus $Help.Examples | Should Not BeNullOrEmpty
Add comment 44 Minus }
Add comment 45 Minus }
Add comment 46 Minus } # End foreach function
Add comment 47 Minus } # End Comment-based help
Add comment 48 Minus
Connection.Tests.ps1
/Tests/Unit/Connection.Tests.ps1/Tests/Unit/Connection.Tests.ps1
Renamed from
/Tests/Unit/001-Connection.Tests.ps1
The file content is identical.