Tests: Fix PSSA (#27)

* Tests: fix indent/align (with Visual Formatter Code)

* Tests: Suppress warning about use ConvertToSecureString...

* Setup(Tests): fix PSSA about unused variable
This commit is contained in:
Alexis La Goutte 2021-09-10 17:38:00 +02:00 committed by GitHub
parent a608d6ebd7
commit 7edbae953f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 52 deletions

View file

@ -11,6 +11,10 @@
DCIM tests. DCIM tests.
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue

View file

@ -11,6 +11,10 @@
A description of the file. A description of the file.
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue

View file

@ -11,6 +11,10 @@
A description of the file. A description of the file.
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue

View file

@ -11,6 +11,10 @@
Helper functions Pester tests Helper functions Pester tests
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue

View file

@ -11,6 +11,10 @@
IPAM Pester tests IPAM Pester tests
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue

View file

@ -11,6 +11,10 @@
Setup function Pester tests Setup function Pester tests
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
@ -43,7 +47,7 @@ Describe "Setup tests" -Tag 'Core', 'Setup' -Fixture {
} }
It "Checks the set credentials" { It "Checks the set credentials" {
$Creds = Set-NetboxCredential -Token (ConvertTo-SecureString -String "faketoken" -Force -AsPlainText) Set-NetboxCredential -Token (ConvertTo-SecureString -String "faketoken" -Force -AsPlainText)
(Get-NetboxCredential).GetNetworkCredential().Password | Should -BeExactly "faketoken" (Get-NetboxCredential).GetNetworkCredential().Password | Should -BeExactly "faketoken"
} }
} }

View file

@ -11,6 +11,10 @@
Virtualization Pester tests Virtualization Pester tests
#> #>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
)
Import-Module Pester Import-Module Pester
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue