forked from loafle/openapi-generator-original
update test case, docstring for timeout
This commit is contained in:
parent
0aa4d2fb8e
commit
2cc5924498
@ -33,7 +33,7 @@ namespace {{packageName}}.Client
|
|||||||
Dictionary<String, String> apiKeyPrefix = null,
|
Dictionary<String, String> apiKeyPrefix = null,
|
||||||
string tempFolderPath = null,
|
string tempFolderPath = null,
|
||||||
string dateTimeFormat = null,
|
string dateTimeFormat = null,
|
||||||
int timeout = 100
|
int timeout = 100000
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (apiClient == null)
|
if (apiClient == null)
|
||||||
@ -82,7 +82,7 @@ namespace {{packageName}}.Client
|
|||||||
public static Configuration Default = new Configuration();
|
public static Configuration Default = new Configuration();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>Timeout.</value>
|
/// <value>Timeout.</value>
|
||||||
public int Timeout
|
public int Timeout
|
||||||
|
@ -33,7 +33,7 @@ namespace IO.Swagger.Client
|
|||||||
Dictionary<String, String> apiKeyPrefix = null,
|
Dictionary<String, String> apiKeyPrefix = null,
|
||||||
string tempFolderPath = null,
|
string tempFolderPath = null,
|
||||||
string dateTimeFormat = null,
|
string dateTimeFormat = null,
|
||||||
int timeout = 100
|
int timeout = 100000
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (apiClient == null)
|
if (apiClient == null)
|
||||||
@ -82,7 +82,7 @@ namespace IO.Swagger.Client
|
|||||||
public static Configuration Default = new Configuration();
|
public static Configuration Default = new Configuration();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>Timeout.</value>
|
/// <value>Timeout.</value>
|
||||||
public int Timeout
|
public int Timeout
|
||||||
|
@ -111,16 +111,13 @@ namespace SwaggerClientTest.TestConfiguration
|
|||||||
public void TestTimeout ()
|
public void TestTimeout ()
|
||||||
{
|
{
|
||||||
Configuration c1 = new Configuration();
|
Configuration c1 = new Configuration();
|
||||||
Assert.AreEqual(c1.Timeout, 100); // default vaue
|
Assert.AreEqual(100000, c1.Timeout); // default vaue
|
||||||
|
|
||||||
c1.Timeout = 10;
|
|
||||||
Assert.AreEqual(c1.Timeout, 10);
|
|
||||||
|
|
||||||
Configuration c2 = new Configuration(timeout: 20);
|
|
||||||
Assert.AreEqual(c2.Timeout, 20);
|
|
||||||
|
|
||||||
|
|
||||||
|
c1.Timeout = 50000;
|
||||||
|
Assert.AreEqual(50000, c1.Timeout);
|
||||||
|
|
||||||
|
Configuration c2 = new Configuration(timeout: 20000);
|
||||||
|
Assert.AreEqual(20000, c2.Timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -114,7 +114,10 @@ namespace SwaggerClientTest.TestPet
|
|||||||
[Test ()]
|
[Test ()]
|
||||||
public void TestGetPetById ()
|
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);
|
Pet response = petApi.GetPetById (petId);
|
||||||
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user