diff --git a/.gitignore b/.gitignore index 942cbf7568..7c0b4fe110 100644 --- a/.gitignore +++ b/.gitignore @@ -218,6 +218,7 @@ samples/server/petstore/erlang-server/rebar.lock samples/client/petstore/dart/petstore/packages samples/client/petstore/dart/flutter_petstore/test/packages samples/client/petstore/dart/petstore/test/packages +**/.dart_tool # JS samples/client/petstore/javascript/package-lock.json diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 12f91133f0..c16815b186 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -49,6 +49,8 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { protected String sourceFolder = ""; protected String apiDocPath = "docs" + File.separator; protected String modelDocPath = "docs" + File.separator; + protected String apiTestPath = "test" + File.separator; + protected String modelTestPath = "test" + File.separator; public DartClientCodegen() { super(); @@ -66,6 +68,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { modelDocTemplateFiles.put("object_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); + modelTestTemplateFiles.put("model_test.mustache", ".dart"); + apiTestTemplateFiles.put("api_test.mustache", ".dart"); + setReservedWordsLowerCase( Arrays.asList( "abstract", "as", "assert", "async", "async*", "await", @@ -214,6 +219,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); } @Override @@ -231,6 +237,16 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); } + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + apiTestPath.replace('/', File.separatorChar); + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + modelTestPath.replace('/', File.separatorChar); + } + @Override public String apiDocFileFolder() { return outputFolder + File.separator + apiDocPath.replace('/', File.separatorChar); @@ -295,6 +311,16 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { return underscore(toApiName(name)); } + @Override + public String toApiTestFilename(String name) { + return toApiFilename(name) + "_test"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelFilename(name) + "_test"; + } + @Override public String toDefaultValue(Schema schema) { if (ModelUtils.isMapSchema(schema)) { diff --git a/modules/openapi-generator/src/main/resources/dart/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/api_test.mustache new file mode 100644 index 0000000000..951aaf86d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{classname}} +void main() { + var instance = new {{classname}}(); + + group('tests for {{classname}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{operationId}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/model_test.mustache new file mode 100644 index 0000000000..89300fed75 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/model_test.mustache @@ -0,0 +1,26 @@ +{{#models}} +{{#model}} +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{classname}} +void main() { + var instance = new Pet(); + + group('test {{classname}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{name}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache index ef8fab4bb2..997448a9be 100644 --- a/modules/openapi-generator/src/main/resources/dart/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache @@ -3,3 +3,5 @@ version: {{pubVersion}} description: {{pubDescription}} dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/modules/openapi-generator/src/main/resources/dart/travis.mustache b/modules/openapi-generator/src/main/resources/dart/travis.mustache new file mode 100644 index 0000000000..82b19541fa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/travis.mustache @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache new file mode 100644 index 0000000000..951aaf86d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{classname}} +void main() { + var instance = new {{classname}}(); + + group('tests for {{classname}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{operationId}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache new file mode 100644 index 0000000000..89300fed75 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -0,0 +1,26 @@ +{{#models}} +{{#model}} +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{classname}} +void main() { + var instance = new Pet(); + + group('test {{classname}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{name}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 008cee0b24..43bb64bb55 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -5,3 +5,5 @@ environment: sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/modules/openapi-generator/src/main/resources/dart2/travis.mustache b/modules/openapi-generator/src/main/resources/dart2/travis.mustache new file mode 100644 index 0000000000..d0758bc9f0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/travis.mustache @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml new file mode 100644 index 0000000000..82b19541fa --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index 79e5223fcd..b63f835e89 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/.travis.yml b/samples/client/petstore/dart/openapi-browser-client/.travis.yml new file mode 100644 index 0000000000..82b19541fa --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml index 79e5223fcd..b63f835e89 100644 --- a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/.travis.yml b/samples/client/petstore/dart/openapi/.travis.yml new file mode 100644 index 0000000000..82b19541fa --- /dev/null +++ b/samples/client/petstore/dart/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/openapi/pubspec.yaml b/samples/client/petstore/dart/openapi/pubspec.yaml index 79e5223fcd..b63f835e89 100644 --- a/samples/client/petstore/dart/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/openapi/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi/test/api_response_test.dart b/samples/client/petstore/dart/openapi/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/category_test.dart b/samples/client/petstore/dart/openapi/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/order_test.dart b/samples/client/petstore/dart/openapi/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/openapi/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/pet_test.dart b/samples/client/petstore/dart/openapi/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/store_api_test.dart b/samples/client/petstore/dart/openapi/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/tag_test.dart b/samples/client/petstore/dart/openapi/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/user_api_test.dart b/samples/client/petstore/dart/openapi/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/user_test.dart b/samples/client/petstore/dart/openapi/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/purge_test.sh b/samples/client/petstore/dart/purge_test.sh new file mode 100755 index 0000000000..b11cf3564d --- /dev/null +++ b/samples/client/petstore/dart/purge_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "purge test fils under 'test' folder" +rm -Rf flutter_petstore/openapi/test/ +rm -Rf openapi/test/ +rm -Rf openapi-browser-client/test diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml new file mode 100644 index 0000000000..d0758bc9f0 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml index 9ccf0e524a..391fa5edec 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi-browser-client/.travis.yml b/samples/client/petstore/dart2/openapi-browser-client/.travis.yml new file mode 100644 index 0000000000..d0758bc9f0 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml index 9ccf0e524a..391fa5edec 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index afa6365606..06b5019af3 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/.travis.yml b/samples/client/petstore/dart2/openapi/.travis.yml new file mode 100644 index 0000000000..d0758bc9f0 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/openapi/pubspec.yaml b/samples/client/petstore/dart2/openapi/pubspec.yaml index 9ccf0e524a..391fa5edec 100644 --- a/samples/client/petstore/dart2/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/openapi/test/api_response_test.dart new file mode 100644 index 0000000000..ebf142904e --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/category_test.dart b/samples/client/petstore/dart2/openapi/test/category_test.dart new file mode 100644 index 0000000000..c5cea4b5bc --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/order_test.dart b/samples/client/petstore/dart2/openapi/test/order_test.dart new file mode 100644 index 0000000000..9982020d8c --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart new file mode 100644 index 0000000000..fa95dccad3 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/pet_test.dart b/samples/client/petstore/dart2/openapi/test/pet_test.dart new file mode 100644 index 0000000000..cfd94b9e36 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/openapi/test/store_api_test.dart new file mode 100644 index 0000000000..496d051e83 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/tag_test.dart b/samples/client/petstore/dart2/openapi/test/tag_test.dart new file mode 100644 index 0000000000..6ee16c51bb --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/openapi/test/user_api_test.dart new file mode 100644 index 0000000000..f040b01bf4 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/user_test.dart b/samples/client/petstore/dart2/openapi/test/user_test.dart new file mode 100644 index 0000000000..5a6340c4f4 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/purge_test.sh b/samples/client/petstore/dart2/purge_test.sh new file mode 100755 index 0000000000..b11cf3564d --- /dev/null +++ b/samples/client/petstore/dart2/purge_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "purge test fils under 'test' folder" +rm -Rf flutter_petstore/openapi/test/ +rm -Rf openapi/test/ +rm -Rf openapi-browser-client/test