Skip to content

Commit 034bd21

Browse files
wing328michaelpro1
authored andcommitted
add test to reuse object from the server (OpenAPITools#5976)
1 parent d519f78 commit 034bd21

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

samples/client/petstore/powershell-experimental/src/PSPetstore/PSPetstore.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: OpenAPI Generator Team
55
#
6-
# Generated on: 4/10/20
6+
# Generated on: 4/19/20
77
#
88

99
@{

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,21 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' {
6363
$file = Get-Item "./plus.gif"
6464
#$Result = Invoke-PSUploadFile -petId $Id -additionalMetadata "Additional data" -File $file
6565

66+
# modify and update
67+
#
68+
$NewPet = $Result["response"]
69+
70+
$NewPet."id" = $NewPet."id" + 1
71+
$NewPet."name" = $NewPet."name" + "PowerShell Modify"
72+
73+
$Result = Update-PSPet -Pet $NewPet
74+
$Result = Get-PSPetById -petId $NewPet."id" -WithHttpInfo
75+
$Result["Response"]."id" | Should Be $NewPet."id"
76+
$Result["Response"]."name" | Should Be $NewPet."name"
77+
6678
# Delete
6779
$Result = Remove-Pet -petId $Id
80+
$Result = Remove-Pet -petId $NewPet."id"
6881

6982
}
7083

0 commit comments

Comments
 (0)