Skip to content

Commit 84566db

Browse files
committed
update tests
1 parent c01693b commit 84566db

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

samples/client/petstore/powershell/tests/Petstore.Tests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
140140

141141
$HS = Get-PSHostSetting
142142

143-
$HS[0]["Url"] | Should -Be "http://{server}.swagger.io:{port}/v2"
144-
$HS[0]["Description"] | Should -Be "petstore server"
145-
$HS[0]["Variables"]["server"]["Description"] | Should -Be "No description provided"
146-
$HS[0]["Variables"]["server"]["DefaultValue"] | Should -Be "petstore"
147-
$HS[0]["Variables"]["server"]["EnumValues"] | Should -Be @("petstore",
143+
$HS[1]["Url"] | Should -Be "http://{server}.swagger.io:{port}/v2"
144+
$HS[1]["Description"] | Should -Be "petstore server"
145+
$HS[1]["Variables"]["server"]["Description"] | Should -Be "No description provided"
146+
$HS[1]["Variables"]["server"]["DefaultValue"] | Should -Be "petstore"
147+
$HS[1]["Variables"]["server"]["EnumValues"] | Should -Be @("petstore",
148148
"qa-petstore",
149149
"dev-petstore")
150150

151151
}
152152

153153
It "Get-PSUrlFromHostSetting tests" {
154-
Get-PSUrlFromHostSetting -Index 0 | Should -Be "http://petstore.swagger.io:80/v2"
155-
Get-PSUrlFromHostSetting -Index 0 -Variables @{ "port" = "8080" } | Should -Be "http://petstore.swagger.io:8080/v2"
154+
Get-PSUrlFromHostSetting -Index 1 | Should -Be "http://petstore.swagger.io:80/v2"
155+
Get-PSUrlFromHostSetting -Index 1 -Variables @{ "port" = "8080" } | Should -Be "http://petstore.swagger.io:8080/v2"
156156
#Get-PSUrlFromHostSetting -Index 2 | Should -Throw -ExceptionType ([RuntimeException])
157157
#Get-PSUrlFromHostSetting -Index 2 -ErrorAction Stop | Should -Throw "RuntimeException: Invalid index 2 when selecting the host. Must -Be less than 2"
158158
#Get-PSUrlFromHostSetting -Index 0 -Variables @{ "port" = "1234" } -ErrorAction Stop | Should -Throw "RuntimeException: The variable 'port' in the host URL has invalid value 1234. Must -Be 80,8080"

0 commit comments

Comments
 (0)