tests/TMD.PowerShell.Tests.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BeforeAll {
    # Import the module file
    if (Get-Module 'TMD.Common') {
        Remove-Module 'TMD.Common' -Force
    }
    Import-Module "TMD.Common" -Force
}

Describe 'Test-TMDIsRunningAction' {
    It 'Returns true when TMD is running' {
        $Global:TmdRunningAction = $true
        Test-TMDIsRunningAction | Should -BeTrue
        $Global:TmdRunningAction = $false
    }
    
    It 'Returns false if TmdRunningAction is null' {
        $Global:TmdRunningAction = $null
        Test-TMDIsRunningAction | Should -BeFalse
    }
}

# TODO: Add the rest of the tests