From 1e8308d84cf2c2c748deae6cfaddbc875eeef199 Mon Sep 17 00:00:00 2001 From: Dimitar Milov Date: Tue, 16 Feb 2021 19:15:49 +0200 Subject: [PATCH] Fix tests taht use old pester syntax --- .../src/test/ConnectDisconnect.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/VMware.vSphere.SsoAdmin/src/test/ConnectDisconnect.Tests.ps1 b/Modules/VMware.vSphere.SsoAdmin/src/test/ConnectDisconnect.Tests.ps1 index 0658ac4..7a69809 100644 --- a/Modules/VMware.vSphere.SsoAdmin/src/test/ConnectDisconnect.Tests.ps1 +++ b/Modules/VMware.vSphere.SsoAdmin/src/test/ConnectDisconnect.Tests.ps1 @@ -54,7 +54,7 @@ Describe "Connect-SsoAdminServer and Disconnect-SsoAdminServer Tests" { -Password ($Password + "invalid") ` -SkipCertificateCheck ` -ErrorAction Stop } | ` - Should Throw "Invalid credentials" + Should -Throw "Invalid credentials" } It 'Connect-SsoAdminServer throws error on invalid Tls Certificate' { @@ -65,7 +65,7 @@ Describe "Connect-SsoAdminServer and Disconnect-SsoAdminServer Tests" { -User $User ` -Password $Password ` -ErrorAction Stop } | ` - Should Throw "The SSL connection could not be established, see inner exception." + Should -Throw "The SSL connection could not be established, see inner exception." } } @@ -160,7 +160,7 @@ Describe "Connect-SsoAdminServer and Disconnect-SsoAdminServer Tests" { # Act { Disconnect-SsoAdminServer -Server $expected } | ` - Should Not Throw + Should -Not -Throw # Assert $global:DefaultSsoAdminServers | Should -Not -Contain $expected