forked from loafle/openapi-generator-original
Merge pull request #2301 from wing328/update_test_file
Update wording for test files
This commit is contained in:
@@ -11,6 +11,13 @@ using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Category
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class CategoryTests
|
||||
{
|
||||
|
||||
@@ -11,6 +11,13 @@ using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Order
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class OrderTests
|
||||
{
|
||||
|
||||
@@ -13,6 +13,13 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing PetApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class PetApiTests
|
||||
{
|
||||
@@ -155,6 +162,19 @@ namespace IO.Swagger.Test
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetPetByIdInObject
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetPetByIdInObjectTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetPetByIdInObject'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.GetPetByIdInObject(petId);
|
||||
Assert.IsInstanceOf<InlineResponse200> (response, "response is InlineResponse200");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test PetPetIdtestingByteArraytrueGet
|
||||
/// </summary>
|
||||
|
||||
@@ -11,6 +11,13 @@ using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class PetTests
|
||||
{
|
||||
|
||||
@@ -13,6 +13,13 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing StoreApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class StoreApiTests
|
||||
{
|
||||
@@ -71,6 +78,18 @@ namespace IO.Swagger.Test
|
||||
Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test GetInventoryInObject
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetInventoryInObjectTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetInventoryInObject'
|
||||
|
||||
var response = instance.GetInventoryInObject();
|
||||
Assert.IsInstanceOf<Object> (response, "response is Object");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test PlaceOrder
|
||||
/// </summary>
|
||||
|
||||
@@ -11,6 +11,13 @@ using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Tag
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class TagTests
|
||||
{
|
||||
|
||||
@@ -13,6 +13,13 @@ using IO.Swagger.Model;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing UserApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class UserApiTests
|
||||
{
|
||||
|
||||
@@ -11,6 +11,13 @@ using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing User
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class UserTests
|
||||
{
|
||||
|
||||
@@ -203,6 +203,28 @@ namespace IO.Swagger.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>InlineResponse200</returns>
|
||||
InlineResponse200 GetPetByIdInObject (long? petId);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of InlineResponse200</returns>
|
||||
ApiResponse<InlineResponse200> GetPetByIdInObjectWithHttpInfo (long? petId);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
@@ -437,6 +459,28 @@ namespace IO.Swagger.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of InlineResponse200</returns>
|
||||
System.Threading.Tasks.Task<InlineResponse200> GetPetByIdInObjectAsync (long? petId);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (InlineResponse200)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<InlineResponse200>> GetPetByIdInObjectAsyncWithHttpInfo (long? petId);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
/// </summary>
|
||||
@@ -1978,6 +2022,192 @@ namespace IO.Swagger.Api
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>InlineResponse200</returns>
|
||||
public InlineResponse200 GetPetByIdInObject (long? petId)
|
||||
{
|
||||
ApiResponse<InlineResponse200> localVarResponse = GetPetByIdInObjectWithHttpInfo(petId);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>ApiResponse of InlineResponse200</returns>
|
||||
public ApiResponse< InlineResponse200 > GetPetByIdInObjectWithHttpInfo (long? petId)
|
||||
{
|
||||
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdInObject");
|
||||
|
||||
|
||||
var localVarPath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// authentication (api_key) required
|
||||
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
// authentication (petstore_auth) required
|
||||
|
||||
// oauth required
|
||||
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<InlineResponse200>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of InlineResponse200</returns>
|
||||
public async System.Threading.Tasks.Task<InlineResponse200> GetPetByIdInObjectAsync (long? petId)
|
||||
{
|
||||
ApiResponse<InlineResponse200> localVarResponse = await GetPetByIdInObjectAsyncWithHttpInfo(petId);
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="petId">ID of pet that needs to be fetched</param>
|
||||
/// <returns>Task of ApiResponse (InlineResponse200)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<InlineResponse200>> GetPetByIdInObjectAsyncWithHttpInfo (long? petId)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetByIdInObject");
|
||||
|
||||
|
||||
var localVarPath = "/pet/{petId}?response=inline_arbitrary_object";
|
||||
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// authentication (api_key) required
|
||||
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
|
||||
// oauth required
|
||||
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||
{
|
||||
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<InlineResponse200>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
/// </summary>
|
||||
|
||||
@@ -59,6 +59,26 @@ namespace IO.Swagger.Api
|
||||
/// <returns>ApiResponse of Dictionary<string, int?></returns>
|
||||
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Object</returns>
|
||||
Object GetInventoryInObject ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Object</returns>
|
||||
ApiResponse<Object> GetInventoryInObjectWithHttpInfo ();
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
@@ -171,6 +191,26 @@ namespace IO.Swagger.Api
|
||||
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Object</returns>
|
||||
System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ();
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory'
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Object)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ();
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
@@ -654,6 +694,165 @@ namespace IO.Swagger.Api
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Object</returns>
|
||||
public Object GetInventoryInObject ()
|
||||
{
|
||||
ApiResponse<Object> localVarResponse = GetInventoryInObjectWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of Object</returns>
|
||||
public ApiResponse< Object > GetInventoryInObjectWithHttpInfo ()
|
||||
{
|
||||
|
||||
|
||||
var localVarPath = "/store/inventory?response=arbitrary_object";
|
||||
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// authentication (api_key) required
|
||||
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of Object</returns>
|
||||
public async System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ()
|
||||
{
|
||||
ApiResponse<Object> localVarResponse = await GetInventoryInObjectAsyncWithHttpInfo();
|
||||
return localVarResponse.Data;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>Task of ApiResponse (Object)</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ()
|
||||
{
|
||||
|
||||
|
||||
var localVarPath = "/store/inventory?response=arbitrary_object";
|
||||
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// authentication (api_key) required
|
||||
|
||||
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
{
|
||||
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||
}
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class InlineResponse200 : IEquatable<InlineResponse200>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InlineResponse200" />class.
|
||||
/// </summary>
|
||||
/// <param name="Id">Id (required).</param>
|
||||
/// <param name="Category">Category.</param>
|
||||
/// <param name="Name">Name.</param>
|
||||
|
||||
public InlineResponse200(long? Id = null, Object Category = null, string Name = null)
|
||||
{
|
||||
// to ensure "Id" is required (not null)
|
||||
if (Id == null)
|
||||
{
|
||||
throw new InvalidDataException("Id is a required property for InlineResponse200 and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Id = Id;
|
||||
}
|
||||
this.Category = Category;
|
||||
this.Name = Name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name="id", EmitDefaultValue=false)]
|
||||
public long? Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Category
|
||||
/// </summary>
|
||||
[DataMember(Name="category", EmitDefaultValue=false)]
|
||||
public Object Category { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class InlineResponse200 {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Category: ").Append(Category).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as InlineResponse200);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if InlineResponse200 instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of InlineResponse200 to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(InlineResponse200 other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Id == other.Id ||
|
||||
this.Id != null &&
|
||||
this.Id.Equals(other.Id)
|
||||
) &&
|
||||
(
|
||||
this.Category == other.Category ||
|
||||
this.Category != null &&
|
||||
this.Category.Equals(other.Category)
|
||||
) &&
|
||||
(
|
||||
this.Name == other.Name ||
|
||||
this.Name != null &&
|
||||
this.Name.Equals(other.Name)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
|
||||
if (this.Id != null)
|
||||
hash = hash * 59 + this.Id.GetHashCode();
|
||||
|
||||
if (this.Category != null)
|
||||
hash = hash * 59 + this.Category.GetHashCode();
|
||||
|
||||
if (this.Name != null)
|
||||
hash = hash * 59 + this.Name.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,7 @@
|
||||
<Compile Include="TestConfiguration.cs" />
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Client\ApiResponse.cs" />
|
||||
<Compile Include="TestOrder.cs" />
|
||||
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\InlineResponse200.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<Properties StartupItem="SwaggerClientTest.csproj">
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs">
|
||||
<Files>
|
||||
<File FileName="TestPet.cs" Line="162" Column="35" />
|
||||
<File FileName="TestOrder.cs" Line="42" Column="12" />
|
||||
<File FileName="TestOrder.cs" Line="1" Column="1" />
|
||||
<File FileName="Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs" Line="8" Column="24" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="MonoDevelop.NUnit.TestPad">
|
||||
|
||||
Reference in New Issue
Block a user