From 5436239a8a11b759efb4f0f4438a9e39f29e993d Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Mon, 6 Sep 2021 06:18:31 +0300 Subject: [PATCH] Test Snipeit-Connect --- SnipeitPS/Public/Connect-SnipeitPS.Tests.ps1 | 24 +++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/SnipeitPS/Public/Connect-SnipeitPS.Tests.ps1 b/SnipeitPS/Public/Connect-SnipeitPS.Tests.ps1 index e1a6c9c..575d9f3 100644 --- a/SnipeitPS/Public/Connect-SnipeitPS.Tests.ps1 +++ b/SnipeitPS/Public/Connect-SnipeitPS.Tests.ps1 @@ -1,19 +1,21 @@ Describe 'Connect-SnipeitPS' { - $SnipeitDev = 'https://develop.snipeitapp.com/' - $SnipeitKey = 'UqddVx6SDb3HLw1Pmw1wGGYHA6w8wWQAiS9kg2xMcz5i75HOULaN3miqYvcPCvHpI2CBfuvdplI8QNm_XzFPmoQRu_5kR8knzla4' - $SnipeitSecKey = ConvertTo-SecureString -Force -AsPlainText -String $SnipeitKey - $SnipeSiteCred = New-Object -Type PSCredential -Argumentlist $SnipeitDev,$SnipeitSecKey + 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 - } + It 'Should connect to api with url and api key' { + Connect-SnipeitPS -url $SnipeitDev -apiKey $SnipeitKey | Should -Not Throw + } - It 'Should connect to api with url and secureapi key' { - Connect-SnipeitPS -url $SnipeitDev -secureApiKey $SnipeitSecKey | Should -Not Throw - } + It 'Should connect to api with url and secureapi key' { + Connect-SnipeitPS -url $SnipeitDev -secureApiKey $SnipeitSecKey | Should -Not Throw + } - It 'Should connect to api with siteCred' { + It 'Should connect to api with siteCred' { Connect-SnipeitPS -siteCred $SnipeSiteCred | Should -Not Throw + } } }