Tests/Add-HPWFExclusion.Tests.ps1
Get-Module HPWriteManager | Remove-Module -Force Push-Location .. Import-Module HPWriteManager -Force Pop-Location Describe "Add-HWFFExclusion Tests" { Context 'Function Output' { It 'should return C:\ExcludedPat' { Mock 'Add-HWFFExclusion' -MockWith { 'C:\ExcludedPath' } Add-HWFFExclusion -Path 'C:\ExcludedPath' | Should -Contain 'Exclusion path C:\ExcludedPath added successfully.' } It 'should have type String as output' { Mock 'Add-HWFFExclusion' -MockWith { 'C:\ExcludedPath' } Add-HWFFExclusion -Path 'C:\ExcludedPath' | Should -BeOfType String } It 'should return verbose output' { Mock 'Add-HWFFExclusion' -MockWith { 'HKLM\\System\\CurrentControlSet\\Services\Tcpip' } Add-HWFFExclusion -Path 'C:\ExcludedPath' -Verbose | Should -Contain 'Verbose' } } } |