resource/dummy/test/public/Get-Dummy.Tests.ps1

Describe "Testing public module function Get-Dummy" -Tag "UnitTest" {
    Context "Generic Context" {
        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 to invoke the module function to test
            Function Get-Dummy {
                . $FunctionPath @args | write-Output
            }

            # Mocking dependencies of the function
            Function Write-Host {
                # This function is a stub and will be replaced in the tests by a Mock command
            }
            Mock Write-Host {
                # Just returns
            }
        }

        It "Get-Dummy should not throw" {
            { Set-Dummy } | Should -Not -Throw
        }

        It "Get-Dummy should return TRUE" {
            $Result = Set-Dummy
            $Result | Should -BeTrue
        }
    }
}