mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 02:35:46 +00:00
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:
parent
a608d6ebd7
commit
7edbae953f
7 changed files with 80 additions and 52 deletions
|
|
@ -11,6 +11,10 @@
|
|||
DCIM tests.
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
A description of the file.
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
A description of the file.
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
Helper functions Pester tests
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
IPAM Pester tests
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
Setup function Pester tests
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
@ -43,7 +47,7 @@ Describe "Setup tests" -Tag 'Core', 'Setup' -Fixture {
|
|||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
Virtualization Pester tests
|
||||
#>
|
||||
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
|
||||
param
|
||||
(
|
||||
)
|
||||
Import-Module Pester
|
||||
Remove-Module NetboxPS -Force -ErrorAction SilentlyContinue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue