tests/Get-MessageTrackingGUI.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 24 25 26 27 28 29 30 31 32 33 34 35 36 |
Describe "PSScriptAnalyzer Test" { Context 'PSScriptAnalyzer Standard Rules' { $analysis = Invoke-ScriptAnalyzer -Path '.\ExchangeTrackingGUI.psm1' $scriptAnalyzerRules = Get-ScriptAnalyzerRule forEach ($rule in $scriptAnalyzerRules) { It "Should pass $rule" { If ($analysis.RuleName -contains $rule) { $analysis | Where-Object RuleName -EQ $rule -outvariable failures | Out-Default $failures.Count | Should Be 0 } } } } } Describe "Create Icon Test" { it "Create Icon success" { Initialize-MTGIcon | Should Not Be $null } } Describe "Get Configuration Test" { it "Get Configuration success" { $Config = Get-MTGConfiguration $Config | Should Not Be $null $Config.PSConnect | Should Not Be $null } } Describe "Save Configuration Test" { it "Save Configuration success" { $Config = Get-MTGConfiguration Save-MTGConfiguration($Config) Get-Item -Path "$($env:LOCALAPPDATA)\ExchangeTrackingGUI\Config.json" -ErrorAction SilentlyContinue | Should Not Be $null } } |