diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 7697bd5b027..07252e685f0 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -51,6 +51,9 @@ public CSharpClientCodegen() { apiPackage = "IO.Swagger.Api"; modelPackage = "IO.Swagger.Model"; + modelTestTemplateFiles.put("model_test.mustache", ".cs"); + apiTestTemplateFiles.put("api_test.mustache", ".cs"); + reservedWords = new HashSet( Arrays.asList( // local variable names in API methods (endpoints) @@ -270,6 +273,16 @@ public String escapeReservedWord(String name) { return "_" + name; } + @Override + public String apiTestFileFolder() { + return outputFolder + ".Test"; + } + + @Override + public String modelTestFileFolder() { + return outputFolder + ".Test"; + } + @Override public String apiFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); @@ -342,6 +355,16 @@ public String toModelFilename(String name) { return toModelName(name); } + @Override + public String toApiTestFilename(String name) { + return toApiName(name) + "Tests"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelName(name) + "Tests"; + } + @Override public Map postProcessOperations(Map objs) { super.postProcessOperations(objs); diff --git a/modules/swagger-codegen/src/main/resources/csharp/README.md b/modules/swagger-codegen/src/main/resources/csharp/README.md index 0e6f969d37a..3ce83da957b 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/README.md +++ b/modules/swagger-codegen/src/main/resources/csharp/README.md @@ -10,5 +10,11 @@ NOTE: The DLLs included in the package may not be the latest version. We recommn ``` Install-Package RestSharp Install-Package Newtonsoft.Json -``` +``` + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] compile-mono.sh +- [Windows] compile.bat +Then include the DLL (under the `bin` folder) in the C# project diff --git a/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache new file mode 100644 index 00000000000..2e638711b0f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/api_test.mustache @@ -0,0 +1,65 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using {{packageName}}.Client; +using {{packageName}}.Api; +{{#hasImport}}using {{packageName}}.Model; +{{/hasImport}} + +namespace {{packageName}}.Test +{ + [TestFixture] + public class {{classname}}Tests + { + private {{classname}} instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new {{classname}}(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{operationId}}InstanceTest() + { + Assert.IsInstanceOf<{{classname}}> (instance, "instance is a {{classname}}"); + } + + {{#operations}}{{#operation}} + /// + /// Test {{operationId}} + /// + [Test] + public void {{operationId}}Test() + { + // TODO: add unit test for the method '{{operationId}}' + {{#allParams}}{{{dataType}}} {{paramName}} = null; // TODO: replace null with proper value + {{/allParams}} + {{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}} + } + {{/operation}}{{/operations}} + } + +} diff --git a/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache new file mode 100644 index 00000000000..5b70f3ebf80 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp/model_test.mustache @@ -0,0 +1,63 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using {{packageName}}.Api; +using {{packageName}}.Model; +using {{packageName}}.Client; +using System.Reflection; + +{{#models}} +{{#model}} +namespace {{packageName}}.Test +{ + [TestFixture] + public class {{classname}}Tests + { + private {{classname}} instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new {{classname}}(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of {{classname}} + /// + [Test] + public void {{classname}}InstanceTest() + { + Assert.IsInstanceOf<{{classname}}> (instance, "instance is a {{classname}}"); + } + + {{#vars}} + /// + /// Test the property '{{name}}' + /// + [Test] + public void {{name}}Test() + { + // TODO: unit test for the property '{{name}}' + } + {{/vars}} + + } + +} +{{/model}} +{{/models}} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/CategoryTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/CategoryTests.cs new file mode 100644 index 00000000000..6384ee4179b --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/CategoryTests.cs @@ -0,0 +1,68 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class CategoryTests + { + private Category instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new Category(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Category + /// + [Test] + public void CategoryInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a Category"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO: unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO: unit test for the property 'Name' + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/OrderTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/OrderTests.cs new file mode 100644 index 00000000000..7d0bc854cef --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/OrderTests.cs @@ -0,0 +1,104 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class OrderTests + { + private Order instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new Order(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Order + /// + [Test] + public void OrderInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a Order"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO: unit test for the property 'Id' + } + + /// + /// Test the property 'PetId' + /// + [Test] + public void PetIdTest() + { + // TODO: unit test for the property 'PetId' + } + + /// + /// Test the property 'Quantity' + /// + [Test] + public void QuantityTest() + { + // TODO: unit test for the property 'Quantity' + } + + /// + /// Test the property 'ShipDate' + /// + [Test] + public void ShipDateTest() + { + // TODO: unit test for the property 'ShipDate' + } + + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO: unit test for the property 'Status' + } + + /// + /// Test the property 'Complete' + /// + [Test] + public void CompleteTest() + { + // TODO: unit test for the property 'Complete' + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs new file mode 100644 index 00000000000..a7caec2f54c --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs @@ -0,0 +1,186 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class PetApiTests + { + private PetApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new PetApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of PetApi + /// + [Test] + public void InstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a PetApi"); + } + + + /// + /// Test UpdatePet + /// + [Test] + public void UpdatePetTest() + { + // TODO: add unit test for the method 'UpdatePet' + Pet body = null; // TODO: replace null with proper value + + instance.UpdatePet(body); + + } + + /// + /// Test AddPet + /// + [Test] + public void AddPetTest() + { + // TODO: add unit test for the method 'AddPet' + Pet body = null; // TODO: replace null with proper value + + instance.AddPet(body); + + } + + /// + /// Test FindPetsByStatus + /// + [Test] + public void FindPetsByStatusTest() + { + // TODO: add unit test for the method 'FindPetsByStatus' + List status = null; // TODO: replace null with proper value + + var response = instance.FindPetsByStatus(status); + Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test FindPetsByTags + /// + [Test] + public void FindPetsByTagsTest() + { + // TODO: add unit test for the method 'FindPetsByTags' + List tags = null; // TODO: replace null with proper value + + var response = instance.FindPetsByTags(tags); + Assert.IsInstanceOf> (response, "response is List"); + } + + /// + /// Test GetPetById + /// + [Test] + public void GetPetByIdTest() + { + // TODO: add unit test for the method 'GetPetById' + long? petId = null; // TODO: replace null with proper value + + var response = instance.GetPetById(petId); + Assert.IsInstanceOf (response, "response is Pet"); + } + + /// + /// Test UpdatePetWithForm + /// + [Test] + public void UpdatePetWithFormTest() + { + // TODO: add unit test for the method 'UpdatePetWithForm' + string petId = null; // TODO: replace null with proper value + string name = null; // TODO: replace null with proper value + string status = null; // TODO: replace null with proper value + + instance.UpdatePetWithForm(petId, name, status); + + } + + /// + /// Test DeletePet + /// + [Test] + public void DeletePetTest() + { + // TODO: add unit test for the method 'DeletePet' + long? petId = null; // TODO: replace null with proper value + string apiKey = null; // TODO: replace null with proper value + + instance.DeletePet(petId, apiKey); + + } + + /// + /// Test UploadFile + /// + [Test] + public void UploadFileTest() + { + // TODO: add unit test for the method 'UploadFile' + long? petId = null; // TODO: replace null with proper value + string additionalMetadata = null; // TODO: replace null with proper value + Stream file = null; // TODO: replace null with proper value + + instance.UploadFile(petId, additionalMetadata, file); + + } + + /// + /// Test GetPetByIdWithByteArray + /// + [Test] + public void GetPetByIdWithByteArrayTest() + { + // TODO: add unit test for the method 'GetPetByIdWithByteArray' + long? petId = null; // TODO: replace null with proper value + + var response = instance.GetPetByIdWithByteArray(petId); + Assert.IsInstanceOf (response, "response is byte[]"); + } + + /// + /// Test AddPetUsingByteArray + /// + [Test] + public void AddPetUsingByteArrayTest() + { + // TODO: add unit test for the method 'AddPetUsingByteArray' + byte[] body = null; // TODO: replace null with proper value + + instance.AddPetUsingByteArray(body); + + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetTests.cs new file mode 100644 index 00000000000..6b203dbd125 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetTests.cs @@ -0,0 +1,104 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class PetTests + { + private Pet instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new Pet(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Pet + /// + [Test] + public void PetInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a Pet"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO: unit test for the property 'Id' + } + + /// + /// Test the property 'Category' + /// + [Test] + public void CategoryTest() + { + // TODO: unit test for the property 'Category' + } + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO: unit test for the property 'Name' + } + + /// + /// Test the property 'PhotoUrls' + /// + [Test] + public void PhotoUrlsTest() + { + // TODO: unit test for the property 'PhotoUrls' + } + + /// + /// Test the property 'Tags' + /// + [Test] + public void TagsTest() + { + // TODO: unit test for the property 'Tags' + } + + /// + /// Test the property 'Status' + /// + [Test] + public void StatusTest() + { + // TODO: unit test for the property 'Status' + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs new file mode 100644 index 00000000000..8e3f99eff2d --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs @@ -0,0 +1,102 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class StoreApiTests + { + private StoreApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new StoreApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of StoreApi + /// + [Test] + public void InstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a StoreApi"); + } + + + /// + /// Test GetInventory + /// + [Test] + public void GetInventoryTest() + { + // TODO: add unit test for the method 'GetInventory' + + var response = instance.GetInventory(); + Assert.IsInstanceOf> (response, "response is Dictionary"); + } + + /// + /// Test PlaceOrder + /// + [Test] + public void PlaceOrderTest() + { + // TODO: add unit test for the method 'PlaceOrder' + Order body = null; // TODO: replace null with proper value + + var response = instance.PlaceOrder(body); + Assert.IsInstanceOf (response, "response is Order"); + } + + /// + /// Test GetOrderById + /// + [Test] + public void GetOrderByIdTest() + { + // TODO: add unit test for the method 'GetOrderById' + string orderId = null; // TODO: replace null with proper value + + var response = instance.GetOrderById(orderId); + Assert.IsInstanceOf (response, "response is Order"); + } + + /// + /// Test DeleteOrder + /// + [Test] + public void DeleteOrderTest() + { + // TODO: add unit test for the method 'DeleteOrder' + string orderId = null; // TODO: replace null with proper value + + instance.DeleteOrder(orderId); + + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/TagTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/TagTests.cs new file mode 100644 index 00000000000..ad772584cc5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/TagTests.cs @@ -0,0 +1,68 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class TagTests + { + private Tag instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new Tag(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Tag + /// + [Test] + public void TagInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a Tag"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO: unit test for the property 'Id' + } + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO: unit test for the property 'Name' + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserApiTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserApiTests.cs new file mode 100644 index 00000000000..0d543c384aa --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserApiTests.cs @@ -0,0 +1,156 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Reflection; +using RestSharp; +using NUnit.Framework; + +using IO.Swagger.Client; +using IO.Swagger.Api; +using IO.Swagger.Model; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class UserApiTests + { + private UserApi instance; + + /// + /// Setup before each unit test + /// + [SetUp] + public void Init() + { + instance = new UserApi(); + } + + /// + /// Clean up after each unit test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of UserApi + /// + [Test] + public void InstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a UserApi"); + } + + + /// + /// Test CreateUser + /// + [Test] + public void CreateUserTest() + { + // TODO: add unit test for the method 'CreateUser' + User body = null; // TODO: replace null with proper value + + instance.CreateUser(body); + + } + + /// + /// Test CreateUsersWithArrayInput + /// + [Test] + public void CreateUsersWithArrayInputTest() + { + // TODO: add unit test for the method 'CreateUsersWithArrayInput' + List body = null; // TODO: replace null with proper value + + instance.CreateUsersWithArrayInput(body); + + } + + /// + /// Test CreateUsersWithListInput + /// + [Test] + public void CreateUsersWithListInputTest() + { + // TODO: add unit test for the method 'CreateUsersWithListInput' + List body = null; // TODO: replace null with proper value + + instance.CreateUsersWithListInput(body); + + } + + /// + /// Test LoginUser + /// + [Test] + public void LoginUserTest() + { + // TODO: add unit test for the method 'LoginUser' + string username = null; // TODO: replace null with proper value + string password = null; // TODO: replace null with proper value + + var response = instance.LoginUser(username, password); + Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test LogoutUser + /// + [Test] + public void LogoutUserTest() + { + // TODO: add unit test for the method 'LogoutUser' + + instance.LogoutUser(); + + } + + /// + /// Test GetUserByName + /// + [Test] + public void GetUserByNameTest() + { + // TODO: add unit test for the method 'GetUserByName' + string username = null; // TODO: replace null with proper value + + var response = instance.GetUserByName(username); + Assert.IsInstanceOf (response, "response is User"); + } + + /// + /// Test UpdateUser + /// + [Test] + public void UpdateUserTest() + { + // TODO: add unit test for the method 'UpdateUser' + string username = null; // TODO: replace null with proper value + User body = null; // TODO: replace null with proper value + + instance.UpdateUser(username, body); + + } + + /// + /// Test DeleteUser + /// + [Test] + public void DeleteUserTest() + { + // TODO: add unit test for the method 'DeleteUser' + string username = null; // TODO: replace null with proper value + + instance.DeleteUser(username); + + } + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserTests.cs new file mode 100644 index 00000000000..4610313b734 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/UserTests.cs @@ -0,0 +1,122 @@ +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; + +namespace IO.Swagger.Test +{ + [TestFixture] + public class UserTests + { + private User instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + instance = new User(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of User + /// + [Test] + public void UserInstanceTest() + { + Assert.IsInstanceOf (instance, "instance is a User"); + } + + + /// + /// Test the property 'Id' + /// + [Test] + public void IdTest() + { + // TODO: unit test for the property 'Id' + } + + /// + /// Test the property 'Username' + /// + [Test] + public void UsernameTest() + { + // TODO: unit test for the property 'Username' + } + + /// + /// Test the property 'FirstName' + /// + [Test] + public void FirstNameTest() + { + // TODO: unit test for the property 'FirstName' + } + + /// + /// Test the property 'LastName' + /// + [Test] + public void LastNameTest() + { + // TODO: unit test for the property 'LastName' + } + + /// + /// Test the property 'Email' + /// + [Test] + public void EmailTest() + { + // TODO: unit test for the property 'Email' + } + + /// + /// Test the property 'Password' + /// + [Test] + public void PasswordTest() + { + // TODO: unit test for the property 'Password' + } + + /// + /// Test the property 'Phone' + /// + [Test] + public void PhoneTest() + { + // TODO: unit test for the property 'Phone' + } + + /// + /// Test the property 'UserStatus' + /// + [Test] + public void UserStatusTest() + { + // TODO: unit test for the property 'UserStatus' + } + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md index 0e6f969d37a..3ce83da957b 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md @@ -10,5 +10,11 @@ NOTE: The DLLs included in the package may not be the latest version. We recommn ``` Install-Package RestSharp Install-Package Newtonsoft.Json -``` +``` + +## Installation +Run the following command to generate the DLL +- [Mac/Linux] compile-mono.sh +- [Windows] compile.bat +Then include the DLL (under the `bin` folder) in the C# project diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs index 11223d88991..681d878531b 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs @@ -4,6 +4,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs index c09efc1acf1..09b595410af 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs @@ -4,6 +4,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs index 313103a3b8a..f36ceed9357 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs @@ -4,6 +4,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs index 2c1cb092a35..fab0081f0bc 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs @@ -4,6 +4,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs index abbcea65b58..42c5b98100f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs @@ -4,6 +4,7 @@ using System.Text; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json;