Skip to content

Commit

Permalink
update tests based on generator
Browse files Browse the repository at this point in the history
  • Loading branch information
LiNk-NY committed May 12, 2020
1 parent 0580ea7 commit b6314c8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 135 deletions.
12 changes: 6 additions & 6 deletions samples/client/petstore/R/tests/testthat/test_order.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test_that("id", {
#expect_equal(model.instance$`id`, "EXPECTED_RESULT")
})

test_that("pet_id", {
# tests for the property `pet_id` (integer)
test_that("petId", {
# tests for the property `petId` (integer)

# uncomment below to test the property
#expect_equal(model.instance$`pet_id`, "EXPECTED_RESULT")
#expect_equal(model.instance$`petId`, "EXPECTED_RESULT")
})

test_that("quantity", {
Expand All @@ -26,11 +26,11 @@ test_that("quantity", {
#expect_equal(model.instance$`quantity`, "EXPECTED_RESULT")
})

test_that("ship_date", {
# tests for the property `ship_date` (character)
test_that("shipDate", {
# tests for the property `shipDate` (character)

# uncomment below to test the property
#expect_equal(model.instance$`ship_date`, "EXPECTED_RESULT")
#expect_equal(model.instance$`shipDate`, "EXPECTED_RESULT")
})

test_that("status", {
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/R/tests/testthat/test_pet.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ test_that("name", {
#expect_equal(model.instance$`name`, "EXPECTED_RESULT")
})

test_that("photo_urls", {
# tests for the property `photo_urls` (character)
test_that("photoUrls", {
# tests for the property `photoUrls` (array[character])

# uncomment below to test the property
#expect_equal(model.instance$`photo_urls`, "EXPECTED_RESULT")
#expect_equal(model.instance$`photoUrls`, "EXPECTED_RESULT")
})

test_that("tags", {
# tests for the property `tags` (Tag)
# tests for the property `tags` (array[Tag])

# uncomment below to test the property
#expect_equal(model.instance$`tags`, "EXPECTED_RESULT")
Expand Down
46 changes: 23 additions & 23 deletions samples/client/petstore/R/tests/testthat/test_pet_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ api.instance <- PetApi$new()

test_that("AddPet", {
# tests for AddPet
# base path: http://petstore.swagger.io/v2
# Add a new pet to the store
# @param body Pet object that needs to be added to the store
# @param [Hash] opts the optional parameters
# @param Pet body Pet object that needs to be added to the store
# @return [Void]

# uncomment below to test the operation
Expand All @@ -18,10 +18,10 @@ test_that("AddPet", {

test_that("DeletePet", {
# tests for DeletePet
# base path: http://petstore.swagger.io/v2
# Deletes a pet
# @param pet.id Pet id to delete
# @param [Hash] opts the optional parameters
# @option opts [character] :api.key
# @param integer pet.id Pet id to delete
# @param character api.key (optional)
# @return [Void]

# uncomment below to test the operation
Expand All @@ -30,34 +30,34 @@ test_that("DeletePet", {

test_that("FindPetsByStatus", {
# tests for FindPetsByStatus
# base path: http://petstore.swagger.io/v2
# Finds Pets by status
# Multiple status values can be provided with comma separated strings
# @param status Status values that need to be considered for filter
# @param [Hash] opts the optional parameters
# @return [Pet]
# @param array[character] status Status values that need to be considered for filter
# @return [array[Pet]]

# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

test_that("FindPetsByTags", {
# tests for FindPetsByTags
# base path: http://petstore.swagger.io/v2
# Finds Pets by tags
# Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
# @param tags Tags to filter by
# @param [Hash] opts the optional parameters
# @return [Pet]
# @param array[character] tags Tags to filter by
# @return [array[Pet]]

# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

test_that("GetPetById", {
# tests for GetPetById
# base path: http://petstore.swagger.io/v2
# Find pet by ID
# Returns a single pet
# @param pet.id ID of pet to return
# @param [Hash] opts the optional parameters
# @param integer pet.id ID of pet to return
# @return [Pet]

# uncomment below to test the operation
Expand All @@ -66,9 +66,9 @@ test_that("GetPetById", {

test_that("UpdatePet", {
# tests for UpdatePet
# base path: http://petstore.swagger.io/v2
# Update an existing pet
# @param body Pet object that needs to be added to the store
# @param [Hash] opts the optional parameters
# @param Pet body Pet object that needs to be added to the store
# @return [Void]

# uncomment below to test the operation
Expand All @@ -77,11 +77,11 @@ test_that("UpdatePet", {

test_that("UpdatePetWithForm", {
# tests for UpdatePetWithForm
# base path: http://petstore.swagger.io/v2
# Updates a pet in the store with form data
# @param pet.id ID of pet that needs to be updated
# @param [Hash] opts the optional parameters
# @option opts [character] :name Updated name of the pet
# @option opts [character] :status Updated status of the pet
# @param integer pet.id ID of pet that needs to be updated
# @param character name Updated name of the pet (optional)
# @param character status Updated status of the pet (optional)
# @return [Void]

# uncomment below to test the operation
Expand All @@ -90,11 +90,11 @@ test_that("UpdatePetWithForm", {

test_that("UploadFile", {
# tests for UploadFile
# base path: http://petstore.swagger.io/v2
# uploads an image
# @param pet.id ID of pet to update
# @param [Hash] opts the optional parameters
# @option opts [character] :additional.metadata Additional data to pass to server
# @option opts [data.frame] :file file to upload
# @param integer pet.id ID of pet to update
# @param character additional.metadata Additional data to pass to server (optional)
# @param data.frame file file to upload (optional)
# @return [ModelApiResponse]

# uncomment below to test the operation
Expand Down
68 changes: 0 additions & 68 deletions samples/client/petstore/R/tests/testthat/test_petstore.R

This file was deleted.

16 changes: 8 additions & 8 deletions samples/client/petstore/R/tests/testthat/test_store_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ api.instance <- StoreApi$new()

test_that("DeleteOrder", {
# tests for DeleteOrder
# base path: http://petstore.swagger.io/v2
# Delete purchase order by ID
# For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
# @param order.id ID of the order that needs to be deleted
# @param [Hash] opts the optional parameters
# @param character order.id ID of the order that needs to be deleted
# @return [Void]

# uncomment below to test the operation
Expand All @@ -19,21 +19,21 @@ test_that("DeleteOrder", {

test_that("GetInventory", {
# tests for GetInventory
# base path: http://petstore.swagger.io/v2
# Returns pet inventories by status
# Returns a map of status codes to quantities
# @param [Hash] opts the optional parameters
# @return [integer]
# @return [map(integer)]

# uncomment below to test the operation
#expect_equal(result, "EXPECTED_RESULT")
})

test_that("GetOrderById", {
# tests for GetOrderById
# base path: http://petstore.swagger.io/v2
# Find purchase order by ID
# For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
# @param order.id ID of pet that needs to be fetched
# @param [Hash] opts the optional parameters
# @param integer order.id ID of pet that needs to be fetched
# @return [Order]

# uncomment below to test the operation
Expand All @@ -42,9 +42,9 @@ test_that("GetOrderById", {

test_that("PlaceOrder", {
# tests for PlaceOrder
# base path: http://petstore.swagger.io/v2
# Place an order for a pet
# @param body order placed for purchasing the pet
# @param [Hash] opts the optional parameters
# @param Order body order placed for purchasing the pet
# @return [Order]

# uncomment below to test the operation
Expand Down
18 changes: 9 additions & 9 deletions samples/client/petstore/R/tests/testthat/test_user.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ test_that("username", {
#expect_equal(model.instance$`username`, "EXPECTED_RESULT")
})

test_that("first_name", {
# tests for the property `first_name` (character)
test_that("firstName", {
# tests for the property `firstName` (character)

# uncomment below to test the property
#expect_equal(model.instance$`first_name`, "EXPECTED_RESULT")
#expect_equal(model.instance$`firstName`, "EXPECTED_RESULT")
})

test_that("last_name", {
# tests for the property `last_name` (character)
test_that("lastName", {
# tests for the property `lastName` (character)

# uncomment below to test the property
#expect_equal(model.instance$`last_name`, "EXPECTED_RESULT")
#expect_equal(model.instance$`lastName`, "EXPECTED_RESULT")
})

test_that("email", {
Expand All @@ -54,11 +54,11 @@ test_that("phone", {
#expect_equal(model.instance$`phone`, "EXPECTED_RESULT")
})

test_that("user_status", {
# tests for the property `user_status` (integer)
test_that("userStatus", {
# tests for the property `userStatus` (integer)
# User Status

# uncomment below to test the property
#expect_equal(model.instance$`user_status`, "EXPECTED_RESULT")
#expect_equal(model.instance$`userStatus`, "EXPECTED_RESULT")
})

Loading

0 comments on commit b6314c8

Please sign in to comment.