Test Snipeit-Connect

This commit is contained in:
Petri Asikainen 2021-09-06 06:22:59 +03:00
parent 5436239a8a
commit 41c5f5d9f9

View file

@ -1,21 +1,21 @@
$script:SnipeitDev = 'https://develop.snipeitapp.com/'
$script:SnipeitKey = 'UqddVx6SDb3HLw1Pmw1wGGYHA6w8wWQAiS9kg2xMcz5i75HOULaN3miqYvcPCvHpI2CBfuvdplI8QNm_XzFPmoQRu_5kR8knzla4'
$script:SnipeitSecKey = ConvertTo-SecureString -Force -AsPlainText -String $SnipeitKey
$script:SnipeSiteCred = New-Object -Type PSCredential -Argumentlist $SnipeitDev,$SnipeitSecKey
Describe 'Connect-SnipeitPS' {
Context "Connections" {
$SnipeitDev = 'https://develop.snipeitapp.com/'
$SnipeitKey = 'UqddVx6SDb3HLw1Pmw1wGGYHA6w8wWQAiS9kg2xMcz5i75HOULaN3miqYvcPCvHpI2CBfuvdplI8QNm_XzFPmoQRu_5kR8knzla4'
$SnipeitSecKey = ConvertTo-SecureString -Force -AsPlainText -String $SnipeitKey
$SnipeSiteCred = New-Object -Type PSCredential -Argumentlist $SnipeitDev,$SnipeitSecKey
It 'Should connect to api with url and api key' {
Connect-SnipeitPS -url $SnipeitDev -apiKey $SnipeitKey | Should -Not Throw
Connect-SnipeitPS -url $script:SnipeitDev -apiKey $script:SnipeitKey | Should -Not Throw
}
It 'Should connect to api with url and secureapi key' {
Connect-SnipeitPS -url $SnipeitDev -secureApiKey $SnipeitSecKey | Should -Not Throw
Connect-SnipeitPS -url $script:SnipeitDev -secureApiKey $script:SnipeitSecKey | Should -Not Throw
}
It 'Should connect to api with siteCred' {
Connect-SnipeitPS -siteCred $SnipeSiteCred | Should -Not Throw
Connect-SnipeitPS -siteCred $script:SnipeSiteCred | Should -Not Throw
}
}
}