resource/dummy/test/private/Get-DummyPrivate.Tests.ps1
Describe "Testing private module function Get-DummyPrivate" -Tag "UnitTest" { Context "A dummy unit test" { BeforeAll { $ModuleRoot = $PSCommandPath | Split-Path -Parent | Split-Path -Parent | Split-Path -Parent $ScriptName = $PSCommandPath | Split-Path -Leaf $Visibility = $PSCommandPath | Split-Path -Parent | Split-Path -Leaf $SourceDirectory = Resolve-Path (Join-Path $ModuleRoot "source\$Visibility") $TestDirectory = Resolve-Path (Join-Path $ModuleRoot "test\$Visibility") $FunctionPath = Join-Path $SourceDirectory ($ScriptName -replace '\.Tests\.ps1$', '.ps1') # Create a Stub for the module function to test Function Invoke-ModuleFunctionStub { . $FunctionPath @args | write-Output } } It "Should return TRUE" { $Result = Invoke-ModuleFunctionStub $Result | Should -BeTrue } } } |