diff --git a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache index 1bd34f844b8..7062a73c1e1 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache @@ -33,7 +33,7 @@ namespace {{packageName}}.Client Dictionary apiKeyPrefix = null, string tempFolderPath = null, string dateTimeFormat = null, - int timeout = 100 + int timeout = 100000 ) { if (apiClient == null) @@ -82,7 +82,7 @@ namespace {{packageName}}.Client public static Configuration Default = new Configuration(); /// - /// Gets or sets the timeout value of ApiClient. Default to 100 seconds. + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. /// /// Timeout. public int Timeout diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/Configuration.cs index c6c2e455949..000b8893cdf 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/Configuration.cs @@ -33,7 +33,7 @@ namespace IO.Swagger.Client Dictionary apiKeyPrefix = null, string tempFolderPath = null, string dateTimeFormat = null, - int timeout = 100 + int timeout = 100000 ) { if (apiClient == null) @@ -82,7 +82,7 @@ namespace IO.Swagger.Client public static Configuration Default = new Configuration(); /// - /// Gets or sets the timeout value of ApiClient. Default to 100 seconds. + /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. /// /// Timeout. public int Timeout diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestConfiguration.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestConfiguration.cs index 4e29c5a2522..140fd269834 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestConfiguration.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestConfiguration.cs @@ -111,16 +111,13 @@ namespace SwaggerClientTest.TestConfiguration public void TestTimeout () { Configuration c1 = new Configuration(); - Assert.AreEqual(c1.Timeout, 100); // default vaue - - c1.Timeout = 10; - Assert.AreEqual(c1.Timeout, 10); - - Configuration c2 = new Configuration(timeout: 20); - Assert.AreEqual(c2.Timeout, 20); - + Assert.AreEqual(100000, c1.Timeout); // default vaue + c1.Timeout = 50000; + Assert.AreEqual(50000, c1.Timeout); + Configuration c2 = new Configuration(timeout: 20000); + Assert.AreEqual(20000, c2.Timeout); } } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs index 7c21f8efeaf..fbbf4494951 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs @@ -114,7 +114,10 @@ namespace SwaggerClientTest.TestPet [Test ()] public void TestGetPetById () { - PetApi petApi = new PetApi (); + // set timeout to 10 seconds + Configuration c1 = new Configuration (timeout: 10000); + + PetApi petApi = new PetApi (c1); Pet response = petApi.GetPetById (petId); Assert.IsInstanceOf (response, "Response is a Pet"); diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll index 22cef5104c5..b0a59cff946 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb index 34cdb18300f..25bc7b803d9 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll index 22cef5104c5..b0a59cff946 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb index 34cdb18300f..25bc7b803d9 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb differ