Tests/Private/Remove-TeamsFunctionsGlobalVariable.Tests.ps1
# Module: TeamsFunctions # Function: Test # Author: David Eberhardt # Updated: 05-AUG-2022 InModuleScope TeamsFunctions { BeforeAll { # } Describe -Tags ('Unit', 'Acceptance') "Function 'Remove-TeamsFunctionsGlobalVariable'" { BeforeEach { Remove-TeamsFunctionsGlobalVariable #| Should -BeNullOrEmpty } It 'should contain at least one TeamsFunctions* Variables' { New-Variable -Name 'TeamsFunctionsVariableRemovalTest' $(Get-Variable | Where-Object Name -Like 'Teamsf*').Count | Should -BeGreaterThan 0 } It 'should remove TeamsFunctions* Variables (except TeamsFunctionsHelpURLBase)' { $Variables = Get-Variable | Where-Object Name -Like 'Teamsf*' $Variables.Count | Should -Not -BeGreaterThan 1 $Variables.Name | Should -Be 'TeamsFunctionsHelpURLBase' } It 'should not remove TF* Variables' { $(Get-Variable | Where-Object Name -Like 'Tf*').Count | Should -BeGreaterThan 0 } It 'should not return anything' { Remove-TeamsFunctionsGlobalVariable | Should -BeNullOrEmpty } } } |